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

ios - Is 'init' forbidden as *part* of a variable name? -

file - Python: AttributeError: 'str' object has no attribute 'readlines' -

c# - Get the Class name in a class with atribute inside a attribute method -