From 10cd9751ea4c76f5f0ebcd0197054b6ac3be563c Mon Sep 17 00:00:00 2001 From: Misko Hevery Date: Tue, 13 Jul 2010 15:21:42 -0700 Subject: ng-change ng:change --- src/widgets.js | 2 +- test/widgetsSpec.js | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/widgets.js b/src/widgets.js index ebfcc456..0b77dbf4 100644 --- a/src/widgets.js +++ b/src/widgets.js @@ -193,7 +193,7 @@ function inputWidget(events, modelAccessor, viewAccessor, initFn) { var scope = this, model = modelAccessor(scope, element), view = viewAccessor(scope, element), - action = element.attr('ng-change') || '', + action = element.attr('ng:change') || '', lastValue; initFn.call(scope, model, view, element); this.$eval(element.attr('ng:init')||''); diff --git a/test/widgetsSpec.js b/test/widgetsSpec.js index 1c9e698a..03f31bfe 100644 --- a/test/widgetsSpec.js +++ b/test/widgetsSpec.js @@ -22,7 +22,7 @@ describe("widget", function(){ describe("text", function(){ it('should input-text auto init and handle keyup/change events', function(){ - compile(''); + compile(''); expect(scope.$get('name')).toEqual("Misko"); expect(scope.$get('count')).toEqual(0); @@ -125,7 +125,7 @@ describe("widget", function(){ }); it('should support type="checkbox"', function(){ - compile(''); + compile(''); expect(scope.checkbox).toEqual(true); click(element); expect(scope.checkbox).toEqual(false); @@ -273,14 +273,14 @@ describe("widget", function(){ expect(scope.$get('name')).toEqual('Kai'); }); - it('should call ng-change on button click', function(){ - compile(''); + it('should call ng:change on button click', function(){ + compile(''); click(element); expect(scope.$get('clicked')).toEqual(true); }); it('should support button alias', function(){ - compile(''); + compile(''); click(element); expect(scope.$get('clicked')).toEqual(true); }); @@ -289,9 +289,9 @@ describe("widget", function(){ it('should support type="radio"', function(){ compile('
' + - '' + - '' + - '' + + '' + + '' + + '' + '
'); var a = element[0].childNodes[0]; var b = element[0].childNodes[1]; @@ -373,8 +373,8 @@ describe("widget", function(){ expect(element.hasClass('ng-exception')).toBeTruthy(); }); - it('should report error on ng-change exception', function(){ - compile(''); + it('should report error on ng:change exception', function(){ + compile(''); click(element); expect(element.hasClass('ng-exception')).toBeTruthy(); }); -- cgit v1.2.3