我有以下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>
和后面的js代码:
$scope.addPath = function() {
$scope.watchedFolders.push($scope.newPathText);
apiService.addScanPath($scope.newPathText)
$scope.newPathText= '';
};
但是,当我调试它并调用 addPath() 时,我看到'$scope.newPathText' 总是为空('')......我在这里遗漏了什么吗?
谢谢