I may not be able to provide proper heading to the question but the requirement for me is to add this piece of html to my layout dynamically and attatch its click events with controller.
我可能无法为问题提供正确的标题,但对我的要求是动态地将这段html添加到我的布局中并使用控制器附加其点击事件。
<div id="subscriber1" class="participant-video-list" >
<div class="participant-call-controls-div">
<div data-id="vm.participantId" ng-click="vm.maximizeParticipant($event)">Maximize</div>
<div data-id="vm.participantId" ng-click="vm.minimizeParticipant($event)">Minimize</div>
</div>
</div>
Is this possible ? If yes then how can i achieve it.
这可能吗 ?如果是,那么我该如何实现它。
Thanks in advance.
提前致谢。
0
It is possible to use ng-include
directive. This directive can include HTML from external file. The explanation can be seen here.
可以使用ng-include指令。该指令可以包含来自外部文件的HTML。可以在这里看到解释。
For example:
例如:
<ng-include src="template"></ng-include>
Work example at plunker(not my).
在plunker(不是我的)的工作示例。
本站翻译的文章,版权归属于本站,未经许可禁止转摘,转摘请注明本文地址:http://www.silva-art.net/blog/2016/11/15/35ad1876948b74b6fecdede74c28d1d4.html。