Mishu Lojan Mishu Lojan - 8 months ago 62
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: