从AngularJS教程egghead.io中获取了它,它似乎永远不会出现在logchore函数中:
app.controller("ChoreCtrl", function($scope) {
$scope.logChore = function() {
alert("is done");
}
})
答案 0 :(得分:2)
将ngclick =“done()”替换为ng-click =“done()”
template: '<input type="text" ng-model="chore">' + ' {{chore}}' + ' <div class="button" ng-click="done()">i m done</div>'
取自小提琴