From e6460685869e16b5016de975fd0ba15a7e436951 Mon Sep 17 00:00:00 2001 From: Misko Hevery Date: Mon, 5 Apr 2010 21:26:52 -0700 Subject: added ng-controller directive --- test/directivesSpec.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'test/directivesSpec.js') diff --git a/test/directivesSpec.js b/test/directivesSpec.js index 06a3a2dd..0a7e3c18 100644 --- a/test/directivesSpec.js +++ b/test/directivesSpec.js @@ -156,4 +156,19 @@ describe("directives", function(){ scope.$eval(); expect(element.css('display')).toEqual(''); }); + + it('should ng-controller', function(){ + window.Greeter = function(){ + this.greeting = 'hello'; + }; + window.Greeter.prototype = { + greet: function(name) { + return this.greeting + ' ' + name; + } + }; + var scope = compile('
'); + expect(scope.greeting).toEqual('hello'); + expect(scope.greet('misko')).toEqual('hello misko'); + delete window.Greeter; + }); }); -- cgit v1.2.3