diff options
| author | Misko Hevery | 2010-03-25 22:03:11 -0700 |
|---|---|---|
| committer | Misko Hevery | 2010-03-25 22:03:11 -0700 |
| commit | d934054cfc22325d817eb0643dc061f9d212804d (patch) | |
| tree | 7828c0b13892cba65968a23db9a8523101c6f903 /test/markupSpec.js | |
| parent | 0cc9b0732003451537a5bfc444fb6590f4ed103a (diff) | |
| download | angular.js-d934054cfc22325d817eb0643dc061f9d212804d.tar.bz2 | |
major refactoring of scope
Diffstat (limited to 'test/markupSpec.js')
| -rw-r--r-- | test/markupSpec.js | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/test/markupSpec.js b/test/markupSpec.js index 8ea88f08..c83f27ff 100644 --- a/test/markupSpec.js +++ b/test/markupSpec.js @@ -8,9 +8,8 @@ describe("markups", function(){ var compiler = new Compiler(angularTextMarkup, angularAttrMarkup, angularDirective, angularWidget); compile = function(html) { element = jqLite(html); - var view = compiler.compile(element)(element); - view.init(); - scope = view.scope; + scope = compiler.compile(element)(element); + scope.$init(); }; }); @@ -24,16 +23,16 @@ describe("markups", function(){ it('should translate {{}} in text', function(){ compile('<div>hello {{name}}!</div>'); expect(element.html()).toEqual('hello <span ng-bind="name"></span>!'); - scope.set('name', 'Misko'); - scope.updateView(); + scope.$set('name', 'Misko'); + scope.$eval(); expect(element.html()).toEqual('hello <span ng-bind="name">Misko</span>!'); }); it('should translate {{}} in terminal nodes', function(){ compile('<select name="x"><option value="">Greet {{name}}!</option></select>'); expect(element.html()).toEqual('<option ng-bind-template="Greet {{name}}!" value=""></option>'); - scope.set('name', 'Misko'); - scope.updateView(); + scope.$set('name', 'Misko'); + scope.$eval(); expect(element.html()).toEqual('<option ng-bind-template="Greet {{name}}!" value="">Greet Misko!</option>'); }); @@ -41,8 +40,8 @@ describe("markups", function(){ compile('<img src="http://server/{{path}}.png"/>'); expect(element.attr('src')).toEqual(); expect(element.attr('ng-bind-attr')).toEqual('{"src":"http://server/{{path}}.png"}'); - scope.set('path', 'a/b'); - scope.updateView(); + scope.$set('path', 'a/b'); + scope.$eval(); expect(element.attr('src')).toEqual("http://server/a/b.png"); }); |
