How to use AngularJS directive for WURFL img-wit with ng-src?

292 Views Asked by At

http://www.scientiamobile.com/page/angularwit

Want to be able to do something like this:

<img-wit ng-src="{{trustSrc(profile.pic)}}" w="100"/>

The picture isn't rendering however, although the blank space is sized correctly. Is it possible to use angular directive version of img-wit with ng-src?

UPDATE:

Determined the easiest way to use img-wit is not to implement angularjs directive at all. Instead, just append appropriate img-wit link prefix inside controller.

1

There are 1 best solutions below

6
On

Support to ngSrc directive has been added in the 0.9.1 version: https://github.com/WURFL/angular-wurfl-image-tailor/releases/tag/0.9.1.

Syntax like the follow is now supported:

<img-wit ng-src="{{myUrl}}"></img-wit>

where {{myUrl}} is the url of the trusted image to load.

Please check https://github.com/WURFL/angular-wurfl-image-tailor#how-to-use-it for further details.

Disclaimer: I work for ScientiaMobile