【发布时间】:2019-01-11 08:19:50
【问题描述】:
我将 html 数据从 angular js post 绑定到 Html div,但在绑定 html 内容中未触发 ng click。
这是我的绑定 html div。
<div ng-app="SupportManagement">
<div ng-controller="SupportCtrl">
<div ng-click="openModal(5)"></div>
<div id="detailBlock"></div>
</div>
</div>
这是我与 Angularjs Post 的绑定函数
angular.module("SupportManagement", [])
.controller("SupportCtrl", function ($scope, $http) {
$scope.openModal = function (ticketId) {
$http.get('SupportDetail.aspx?ticketId='+ticketId).then(function (response) {
$("#detailBlock").html(response.data);
},
function (error) {
alert("fail");
alert(error);
}
);
}
$scope.openTicketHistory=function(){
var id= $('#tckId').attr('prob');
$http.post('SupportDetail.aspx/ShowHistory',
{ ticketId: id }).then(function (success) {
alert("success")
}
);
}
});
这个地方是我在detailBlock div 中调用openTicketHistory 函数。并且不触发ngClick 事件。我能做什么?
【问题讨论】:
标签: javascript jquery html angularjs