Mishu Lojan Mishu Lojan - 1 year ago 99
AngularJS Question

Ng-change not working properly in angularjs

I'm using a input type= number , but I cannot get my ng-change function to call.

<input type="number" name="numero" placeholder="1234 1234 1234 1234" ng-model="card.numero" ng-change="validar_card()" required>

my controller

$scope.validar_card=function () {

Answer Source

In your controller you forgot to put $scope in your console.log:


Also dont forget to put $scope.card = {} in the beggining of the controller. Below fiddle:


Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download