javascript - process angular function on view renedring -
I have the image URL in this format in the database
http: // www. nobrok .com / roomrent1 / public / uploads / 5269 / b4a3263f52c1c4725096ee299fa2c64051cb9b4d.jpg :: I'm trying to pass the image URL to an angular controllers method like this < / P>
& lt; Img src = "size image (comment pictures)" & gt; I have written a function to process the
$ scope.sizeImg = function (image) {return 'http like URL: / / Www .nobrok.com / roomrent1 / public / upload / 5269 / b4a3263f52c1c4725096ee299fa2c64051cb9b4d.jpg '; } but the function is not working
T do not work now in src straight JavaScript, and mentioned angular documentation ngSrc using angular markup like "{{hash}} in the src attribute see" Anji- src.
& lt; Img ng-src = "{{sizeImg (comment.pictures)}}" & gt; Coding example:
Comments
Post a Comment