From 703f68fb0bbcccb54d985845997a26b25892740d Mon Sep 17 00:00:00 2001 From: Andy Joslin Date: Tue, 11 Mar 2014 13:26:21 -0600 Subject: [PATCH] test(ionicView): update --- js/ext/angular/src/service/ionicModal.js | 8 ++++---- js/ext/angular/test/directive/ionicView.unit.js | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/js/ext/angular/src/service/ionicModal.js b/js/ext/angular/src/service/ionicModal.js index b60838c8e2..0edd55714a 100644 --- a/js/ext/angular/src/service/ionicModal.js +++ b/js/ext/angular/src/service/ionicModal.js @@ -203,12 +203,12 @@ angular.module('ionic.service.modal', ['ionic.service.templateLoad', 'ionic.serv * @returns {promise} A promise that will be resolved with an instance of * an {@link ionic.controller:ionicModal} controller. */ - fromTemplateUrl: function(url, options) { + fromTemplateUrl: function(url, options, _) { var cb; //Deprecated: allow a callback as second parameter. Now we return a promise. - if (arguments.length === 3) { - cb = arguments[1]; - options = arguments[2] || {}; + if (angular.isFunction(options)) { + cb = options; + options = _; } return $ionicTemplateLoader.load(url).then(function(templateString) { var modal = createModal(templateString, options || {}); diff --git a/js/ext/angular/test/directive/ionicView.unit.js b/js/ext/angular/test/directive/ionicView.unit.js index 3f6f40a6f2..1bbd060934 100644 --- a/js/ext/angular/test/directive/ionicView.unit.js +++ b/js/ext/angular/test/directive/ionicView.unit.js @@ -23,11 +23,11 @@ describe('Ionic View', function() { it('should broacast view enter on link', function() { spyOn(scope, '$broadcast'); - var element = compile('')(scope); + var element = compile('')(scope); expect(scope.$broadcast).toHaveBeenCalledWith('viewState.viewEnter', { title: 'Me Title', navDirection: undefined }); scope.$navDirection = 'forward'; - element = compile('')(scope); + element = compile('')(scope); expect(scope.$broadcast).toHaveBeenCalledWith('viewState.viewEnter', { title: 'Me Title', navDirection: 'forward' }); }); @@ -109,7 +109,7 @@ describe('Ionic View', function() { it('should show and update navBar title when using view attr or events', function() { scope.viewTitle = 'Title'; - var element = compile('
')(scope); + var element = compile('
')(scope); scope.$digest(); var navBar = element.find('header'); var title = navBar.find('h1');