How to make a dynamically retrieved image clickable in angularjs -


i have retrieved image , corresponding data dynamically, in want make image clickable redirect webpage. how can achieve using angularjs.

i using angularjs, no jquery.

below can see can assign values object , use object on image tag. if want make other changes on click can use ng-click shown below use $location.url.

$scope.object = {}; $scope.object.filepath = filepath; $scope.object.redirecturl = redirecturl  <img ng-src="object.filepath" ui-sref="{{object.redirecturl}}" />  $scope.redirect = function(redirecturl) {     $location.url(redirecturl); };    <img ng-src="object.filepath" ng-click="redirect(redirecturl)" /> 

Comments

Popular posts from this blog

sequelize.js - Sequelize group by with association includes id -

android - Robolectric "INTERNET permission is required" -

java - Android raising EPERM (Operation not permitted) when attempting to send UDP packet after network connection -