why my ng-model doesn't bind?
I have the following html:
<form ng-submit="addPath()">
<input type="text" ng-model="newPathText" style="width:
500px;" placeholder="Enter a local or network folder
location (e.g., K:\documents\new-york)">
<input class="btn-primary" type="submit" value="add"
style="margin-bottom: 10px">
</form>
and the js code behind:
$scope.addPath = function() {
$scope.watchedFolders.push($scope.newPathText);
apiService.addScanPath($scope.newPathText)
$scope.newPathText= '';
};
however, when i debug it and the addPath() is being called, i see that
'$scope.newPathText' is always coming empty ('')...am i missing anything
here?
Thanks
No comments:
Post a Comment