Capture image by url

Asked

Viewed 312 times

5

1 answer

3


Using ng-src. Example to follow:

var app = angular.module('sampleApp', []);

app.controller('SampleController', function ($scope, $http) {

$scope.codigos = ['Nautilus','Azir','Ekko'];
  
});
<script src="//cdnjs.cloudflare.com/ajax/libs/angular.js/1.4.9/angular.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/angular.js/1.4.9/angular-resource.js"></script>
<div ng-app="sampleApp">

  <div ng-controller="SampleController">
    
    <img ng-src='http://ddragon.leagueoflegends.com/cdn/6.3.1/img/champion/{{i}}.png' ng-repeat='i in codigos'/>

  </div>
</div>

Browser other questions tagged

You are not signed in. Login or sign up in order to post.