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/ValidatorsSpec.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'test/ValidatorsSpec.js') diff --git a/test/ValidatorsSpec.js b/test/ValidatorsSpec.js index 2d4fca98..773ac7d0 100644 --- a/test/ValidatorsSpec.js +++ b/test/ValidatorsSpec.js @@ -7,7 +7,7 @@ describe('ValidatorTest', function(){ validator.last = last; validator._this = this; }; - var scope = compile('')().scope; + var scope = compile('')(); scope.name = 'misko'; scope.$eval(); assertEquals('misko', validator.first); @@ -95,7 +95,7 @@ describe('ValidatorTest', function(){ beforeEach(function(){ value = null; fn = null; - self = angular.compile('')().scope; + self = angular.compile('')(); jqLite(document.body).append(self.$element); self.$element.data('$validate', noop); self.$root = self; @@ -108,7 +108,7 @@ describe('ValidatorTest', function(){ it('should make a request and show spinner', function(){ var value, fn; var scope = angular.compile( - '')().scope; + '')(); jqLite(document.body).append(scope.$element); var input = scope.$element; scope.asyncFn = function(v,f){ @@ -151,7 +151,7 @@ describe('ValidatorTest', function(){ it("should handle update function", function(){ var scope = angular.compile( - '')().scope; + '')(); scope.asyncFn = jasmine.createSpy(); scope.updateFn = jasmine.createSpy(); scope.name = 'misko'; -- cgit v1.2.3