为什么图像网格不在angularjs ng repeat中扩展,但javascript工作正常?
我想像google images一样扩展图像搜索这里是JSFIDLE与javascript代码的链接它工作正常[javascript图像扩展][1]为什么图像网格不在angularjs ng repeat中扩展,但javascript工作正常?,javascript,jquery,angularjs,angularjs-ng-repeat,Javascript,Jquery,Angularjs,Angularjs Ng Repeat,我想像google images一样扩展图像搜索这里是JSFIDLE与javascript代码的链接它工作正常[javascript图像扩展][1] [1]: http://fiddle.jshell.net/XDaEk/638/ 但我想使用angularjs ng repeat扩展图像,但它不起作用,这里是JSFIDLE angularjs代码的链接[angularjs image expand][2] [2]: http://jsfiddle.net/36BYs/56/ 在调用im
[1]: http://fiddle.jshell.net/XDaEk/638/
但我想使用angularjs ng repeat扩展图像,但它不起作用,这里是JSFIDLE angularjs代码的链接[angularjs image expand][2]
[2]: http://jsfiddle.net/36BYs/56/
在调用imageexpander逻辑之前,ng repeat未完成其元素的生成。在调用它之前,必须等待创建ng repeat的dom节点
function MainCtrl( $scope, $timeout ) {
$scope.mydeom = [
{image: 'http://www.jqueryscript.net/demo/Thumbnail-Grid-with-Expanding-Image-Preview-Using-jQuery/example/1.jpg',name:'Loren'},
{image: 'http://www.jqueryscript.net/demo/Thumbnail-Grid-with-Expanding-Image-Preview-Using-jQuery/example/2.jpg',name:'Marry'}
];
$timeout(function() {
window.jQuery('.gallery-items').imagelistexpander({
prefix: "gallery-"
});
})
}