简体   繁体   English

AngularJs ng-click在jQuery可测网格视图中不起作用

[英]AngularJs ng-click not working in jquery dynatable grid view

I am creating an html with ng-repeat like: 我正在创建一个带有ng-repeat的html,例如:

var li = '<div ng-repeat="list in viewsList">...</div>';

and then using 然后使用

 var html = angular.element(li);
 angular.element("#grid-view-list").html($compile(html)($scope));

to compile my code. 来编译我的代码。 After this I try to create jquery dynatable, in which I am pretty successful. 在此之后,我尝试创建可动态化的jquery,在其中我非常成功。 However, all the events like ng-click etc. in my code stop working after this. 但是,此后,我代码中的所有事件(如ng-click等)均停止工作。
Adding plunker . 加塞子

Any suggestions or help would be great contribution. 任何建议或帮助将是巨大的贡献。

ng-click won't work inside ng-repeat most of the times. ng-click在大多数情况下都无法在ng-repeat中使用。

Because ng-repeat creates a new scope. 因为ng-repeat创建了一个新的作用域。

Please go through this link : https://github.com/angular/angular.js/wiki/Understanding-Scopes 请通过以下链接查看: https : //github.com/angular/angular.js/wiki/Understanding-Scopes

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM