My application displays Quantity: {{num}}
. The default value is set to 3 in the scope. The objective is to click on:
<form ng-submit="addContact()">
<input class="btn-primary" type="submit" value="Add Contact">
</form>
and to update the quantity. However, it fails to do so.
This is my code snippet from the controller:
app.controller("MainController", function($scope){
var count = 3;
$scope.num = count;
$scope.addContact = function()
{
count += 1;
console.log(count);
}
});
I can see the updated count in the console, but it doesn't reflect in the DOM. What am I overlooking?