From 945056b1667a69ecc4d557cc0f03894597250ced Mon Sep 17 00:00:00 2001 From: Igor Minar Date: Fri, 25 Feb 2011 14:03:02 -0800 Subject: linking function should return bound scope angular.compile()() returns {scope:scope, view:view}, this isn't useful at all and only makes tests more verbose. Instead, this change makes the linking function return scope directly and if anyone needs the linked dom there are two ways to do it documented in angular.compile. other changes: - moved angular.compile docs to the compiler so that they are closer to the compiler - fixed some typos and updated angular.compile docs with the new return value --- test/service/invalidWidgetsSpec.js | 2 +- test/service/routeSpec.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'test/service') diff --git a/test/service/invalidWidgetsSpec.js b/test/service/invalidWidgetsSpec.js index 4a18dcf8..de9ed14b 100644 --- a/test/service/invalidWidgetsSpec.js +++ b/test/service/invalidWidgetsSpec.js @@ -14,7 +14,7 @@ describe('$invalidWidgets', function() { it("should count number of invalid widgets", function(){ var element = jqLite('') jqLite(document.body).append(element); - scope = compile(element)().scope; + scope = compile(element)(); var $invalidWidgets = scope.$service('$invalidWidgets'); expect($invalidWidgets.length).toEqual(1); diff --git a/test/service/routeSpec.js b/test/service/routeSpec.js index 4dfa546c..ccdf19ec 100644 --- a/test/service/routeSpec.js +++ b/test/service/routeSpec.js @@ -18,7 +18,7 @@ describe('$route', function() { function BookChapter() { this.log = ''; } - scope = compile('
')().scope; + scope = compile('
')(); $location = scope.$service('$location'); $route = scope.$service('$route'); $route.when('/Book/:book/Chapter/:chapter', {controller: BookChapter, template:'Chapter.html'}); -- cgit v1.2.3