aboutsummaryrefslogtreecommitdiffstats
path: root/test/ValidatorsSpec.js
diff options
context:
space:
mode:
authorIgor Minar2011-02-25 14:03:02 -0800
committerIgor Minar2011-03-01 17:09:25 -0800
commit945056b1667a69ecc4d557cc0f03894597250ced (patch)
tree396c0ff155fe895933cbd3301874e8799fd42b65 /test/ValidatorsSpec.js
parent128feb267409ee45ee5225a34aab038ddf3518fa (diff)
downloadangular.js-945056b1667a69ecc4d557cc0f03894597250ced.tar.bz2
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
Diffstat (limited to 'test/ValidatorsSpec.js')
-rw-r--r--test/ValidatorsSpec.js8
1 files changed, 4 insertions, 4 deletions
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('<input name="name" ng:validate="myValidator:\'hevery\'"/>')().scope;
+ var scope = compile('<input name="name" ng:validate="myValidator:\'hevery\'"/>')();
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('<input />')().scope;
+ self = angular.compile('<input />')();
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(
- '<input type="text" name="name" ng:validate="asynchronous:asyncFn"/>')().scope;
+ '<input type="text" name="name" ng:validate="asynchronous:asyncFn"/>')();
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(
- '<input name="name" ng:validate="asynchronous:asyncFn:updateFn"/>')().scope;
+ '<input name="name" ng:validate="asynchronous:asyncFn:updateFn"/>')();
scope.asyncFn = jasmine.createSpy();
scope.updateFn = jasmine.createSpy();
scope.name = 'misko';