0
我是Angular JS的新手。但是,找不到單線或簡單的解決方案。 我想在輸入文本框中實現「剩餘字符數」,但explorationObjectiveService.displayed
的值爲undefined
。幫助讚賞。
HTML
<input id="explorationObjective" type="text"
class="form-control protractor-test-exploration-objective-input"
ng-model="explorationObjectiveService.displayed"
ng-blur="saveExplorationObjective()" placeholder="Learn how to ..." maxlength="100">
指令JS
$scope.counter= 100 - ($scope.explorationObjectiveService.displayed).length;
錯誤的括號:($範圍。 EXP lorationObjectiveService.displayed.length); – Groben
圓括號不會影響任何內容@Groben – taguenizy
添加指令腳本 –