I have this HTML :
<form ng-submit="addComment()">
<md-input-container flex>
<label>Shoutout</label>
<input type="text" ng-model="comment">
</md-input-container>
</form>
and in my Controller :
$scope.comment = "";
$scope.addComment = function(){
console.log("Value from input", $scope.comment);
$scope.comment = "test"
console.log("New Value", $scope.comment);
}
It works fine when im typing on the input
the model is updating and all. But when I press enter I expect the value from the input to be logged on the console. But it seems that it cannot get the updated value from the ng-model
.