【发布时间】:2013-07-07 00:59:45
【问题描述】:
我一直在寻找一个简单但并非微不足道的问题的答案:什么是仅使用 jqLite 在 Angular 中捕获图像'onload 事件的正确方法?我找到了 this question ,但我想要一些带有指令的解决方案。
所以正如我所说,这对我来说是不被接受的:
.controller("MyCtrl", function($scope){
// ...
img.onload = function () {
// ...
}
因为它在控制器中,而不是在指令中。
【问题讨论】:
标签: javascript angularjs angularjs-directive onload jqlite