Ng-lazyload-image: ng:无法绑定到“lazyLoad”,因为它不是“img”的已知属性

创建于 2017-12-09  ·  3评论  ·  资料来源: tjoskar/ng-lazyload-image




最后一张:http ://wx1.sinaimg.cn/mw690/9b5fc159ly1fmahepbh5vj20er0asmxs.jpg

我使用 ng版本:5

最有用的评论

只需要在imports下添加LazyLoadImageModule就可以了,不需要在声明下指定LazyLoadImageDirective

你在使用 SSR 吗? 如果是这样,请确保在共享 app.module 中的导入下包含LazyLoadImageModule 。 或者,如果您没有共享的,则将其包含在客户端和服务器 app.modules 中。

它在 Angular 5.1.0 上对我来说很好用

所有3条评论

只需要在imports下添加LazyLoadImageModule就可以了,不需要在声明下指定LazyLoadImageDirective

你在使用 SSR 吗? 如果是这样,请确保在共享 app.module 中的导入下包含LazyLoadImageModule 。 或者,如果您没有共享的,则将其包含在客户端和服务器 app.modules 中。

它在 Angular 5.1.0 上对我来说很好用

尝试在shared.module中导入LazyLoadImageModule结果,发现问题解决了。
抱歉,我使用谷歌翻译。
谢谢yoooooooooo!!
@sapierens

很高兴你的问题得到了解决@muxi2015

谢谢,@sapierens!

此页面是否有帮助?
0 / 5 - 0 等级

相关问题

AzerHeshim picture AzerHeshim  ·  5评论

vincent-cm picture vincent-cm  ·  10评论

audacitus picture audacitus  ·  5评论

myrsk picture myrsk  ·  6评论

walfro picture walfro  ·  11评论