i am using ng-repeat to populate a image list. i need to use $index for naming the images and use it for replacing src of preview div. $index is not replacing in mouseover section while its getting replaced in name section. what can be the reason and how to correct it.
<img onmouseover="preview.src=img{{$index}}.src" name="img{{$index}}" src="{{image.SMALL_PATH}}" alt="" ng-repeat="image in images | filter:query"/>
<div class="preview" align="center">
<img name="preview" src="images/img1.jpg" alt=""/>
</div>
使用ng-src
和ng-mouseover
您的代码段将是
<img data-ng-mouseover="preview.src=image.src" name="image.name" data-ng-src="image.SMALL_PATH" alt="" ng-repeat="image in images | filter:query"/>
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.