how to call function using angularjs ng-click on template that has render from controller of grails. i have try this. but jquery function calling works well.. but ng-click() function not working..what wrong with me.i am battling with this.
我的 Controller 功能:
$scope.editTasks = function(){
console.log("uu");
}
我的模板已在表内呈现代码:
<button class="table-icon editIcon" ng-click="editTasks()" />
最佳答案
您必须定义一个 Controller 并将按钮包装在其中:
HTML:
<div ng-controller="theCtrl">
<button class="table-icon editIcon" ng-click="editTasks()" />
</div>
JS:
app.controller('theCtrl', function($scope) {
$scope.editTasks = function(){
console.log("uu");
}
});
关于javascript - 如何使用 AngularJS 调用函数 ng 单击已从 Grails Controller 渲染的模板,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32549064/