angularjs - 如何将 AngularJS 指令与 ng-src 一起用于 WURFL img-wit?

标签 angularjs angularjs-directive image-size wurfl

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

希望能够做这样的事情:

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

尽管空白区域的大小正确,但图片并未渲染。是否可以将 img-wit 的 Angular 指令版本与 ng-src 一起使用?

更新:

确定使用 img-wit 的最简单方法是根本不实现 angularjs 指令。相反,只需在 Controller 内附加适当的 img-wit 链接前缀即可。

最佳答案

0.9.1版本中添加了对ngSrc指令的支持:https://github.com/WURFL/angular-wurfl-image-tailor/releases/tag/0.9.1 .

现在支持如下语法:

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

其中 {{myUrl}} 是要加载的可信图像的 URL。

请查看https://github.com/WURFL/angular-wurfl-image-tailor#how-to-use-it了解更多详情。

免责声明:我在 ScientiaMobile 工作

关于angularjs - 如何将 AngularJS 指令与 ng-src 一起用于 WURFL img-wit?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27538060/

相关文章:

javascript - angularjs - 如何将输入元素转换为列表元素

AngularJS : How to get the uncompiled transclude content of a directive

node.js - NodeJS : How to use image-size with base64 image?

Android 背景图像大小(以像素为单位)

javascript - AngularJS 中 module.provider() 的两种不同实现

css - AngularJS 动画交换表中的行

angularjs - 带有 Bootstrap 4 的 Angular UI 模式

angularjs - 在AngularJS指令中获得第一个 child

javascript - 试图嵌入一个选择元素

ios - 以 MB 格式显示图像大小 IOS 7