aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMisko Hevery2010-07-13 15:21:42 -0700
committerMisko Hevery2010-07-13 15:21:42 -0700
commit10cd9751ea4c76f5f0ebcd0197054b6ac3be563c (patch)
treeab0c9b24f63aa99f31e69e64efe9b9a763a28d4b
parent87cfc27be331685043ea2a4414eba4fd8fbb4a2c (diff)
downloadangular.js-10cd9751ea4c76f5f0ebcd0197054b6ac3be563c.tar.bz2
ng-change ng:change
-rw-r--r--src/widgets.js2
-rw-r--r--test/widgetsSpec.js20
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('<input type="Text" name="name" value="Misko" ng-change="count = count + 1" ng:init="count=0"/>');
+ compile('<input type="Text" name="name" value="Misko" ng:change="count = count + 1" ng:init="count=0"/>');
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('<input type="checkBox" name="checkbox" checked ng-change="action = true"/>');
+ compile('<input type="checkBox" name="checkbox" checked ng:change="action = true"/>');
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('<input type="button" value="Click Me" ng-change="clicked = true"/>');
+ it('should call ng:change on button click', function(){
+ compile('<input type="button" value="Click Me" ng:change="clicked = true"/>');
click(element);
expect(scope.$get('clicked')).toEqual(true);
});
it('should support button alias', function(){
- compile('<button ng-change="clicked = true">Click Me</button>');
+ compile('<button ng:change="clicked = true">Click Me</button>');
click(element);
expect(scope.$get('clicked')).toEqual(true);
});
@@ -289,9 +289,9 @@ describe("widget", function(){
it('should support type="radio"', function(){
compile('<div>' +
- '<input type="radio" name="chose" value="A" ng-change="clicked = 1"/>' +
- '<input type="radio" name="chose" value="B" checked ng-change="clicked = 2"/>' +
- '<input type="radio" name="chose" value="C" ng-change="clicked = 3"/>' +
+ '<input type="radio" name="chose" value="A" ng:change="clicked = 1"/>' +
+ '<input type="radio" name="chose" value="B" checked ng:change="clicked = 2"/>' +
+ '<input type="radio" name="chose" value="C" ng:change="clicked = 3"/>' +
'</div>');
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('<button ng-change="a-2=x">click</button>');
+ it('should report error on ng:change exception', function(){
+ compile('<button ng:change="a-2=x">click</button>');
click(element);
expect(element.hasClass('ng-exception')).toBeTruthy();
});