我不知道为什么使用以下模板ng-click不起作用:
<div>
<md-icon ng-click="console.log('hello'); $event.stopPropagation();" md-font-icon layout-fill ng-
class="md-raised inline-icon fa statusCellIcon" style="z-index:1000;">
</md-icon>
$ event.stopPropagation()执行但不执行console.log。
有人知道为什么吗?
谢谢。
答案 0 :(得分:0)
尝试添加:
variable $scope.console = window.console;
答案 1 :(得分:0)
如果有人感兴趣的解决方案是:
通过将以下内容添加到网格选项中,将方法公开到ui-grid:
$.ajax({
url: '@Url.Action("Action", "Controller")',
type: "POST",
data: { 'checados': checked },
dataType: "jsonp",
cache: false,
success: function (results) {
var result = [];
var event;
for (var i = 0; i < results.length; i++) {
event = results[i];
result.push(new kendo.data.SchedulerEvent({
id: event.ID,
title: event.Title,
description: event.Description,
start: kendo.parseDate(event.Start),
end: kendo.parseDate(event.End),
isAllDay: event.IsAllDay,
recurrenceException: event.RecurrenceException,
recurrenceId: event.RecurrenceId,
recurrenceRule: event.RecurrenceRule,
resource: event.Resource,
}));
}
var resource = sch.resources[0];
resource.dataSource.read();
sch.setDataSource(result);
sch.refresh();
},
error: function () {
alert('Error occured');
}
});
在网格的ColumnTemplate中添加以下代码:
appScopeProvider: someFunction: function () { doSomeThing(); }