I'm able to insert one image into a div using angular.js.But unable to insert three images into a div.Can anyone please help me out regarding this issue ...
My js code:
angular.module('Admin', [])
.controller('Home', function($scope) {
$scope.imageSources = [];
for (var i = 0; i < 3; i++) {
$scope.imageSources .push('images/open.jpg');
$scope.imageSources .push('images/new.jpg');
$scope.imageSources .push('images/save.jpg');
}
});
My html code:
<div id="divone" class="subdiv">
<div>
<img width=176 height=99 ng-repeat="imageSource in imageSources track by $index" ng-src="{{imageSource }}">
</img>
</div>
</div>
forloop, you're essentially pushing each of those URLs every times, making 9 entries to your array. Also what does the class.subdivlook like? I was able to recreate this with no issue in a codepen. - codepen.io/jusopi/pen/EPNgpz