angularjs - why does {form.$valid} not match $scope.form.$valid -


in html, have input type submit tag following attribute

disabled="{form.$valid}" 

in controller have

if ($scope.form.$valid) { 

if remove disabled attribute, able submit form, if add in, not.

any idea why {form.$valid} not match $scope.form.$valid ?

cheers

try using notation:

<input type="submit" ng-disabled="form.$valid"> 

it's angular ngdisabled core directive doing want.


Comments

Popular posts from this blog

c++ - Do gcc's __float128 floating point numbers take the current rounding mode into account? -

java - the value of local variable is not used -