基于台式机或移动设备的Angular 2不同视图 [英] Angular 2 different views based on Desktop or Mobile
问题描述
我正在网站上工作,该网站的功能基于台式机/移动版略有不同.
I'm working on web site, that has slight different functionality based on version desktop/mobile.
我试图通过@View应用它,但是看起来这个装饰器现在已被弃用. 请告诉我最佳实践,即如何在Angular 2中实现此功能.
I tried to apply it via @View, but it looks like this decorator is now deprecated. Please, advise me best practice, how to implement this feature in Angular 2.
推荐答案
ng2-responsive
软件包应满足您的需求: https://www.npmjs.com/package/ng2-响应
The ng2-responsive
package should cover your needs: https://www.npmjs.com/package/ng2-responsive
我还没有广泛使用它,但是它似乎做得不错.
I haven't used it extensively yet, but it seems to be doing a decent job.
@View
被合并到@Component
中(以前). @Component
应该是您唯一需要的装饰器.
@View
was merged into @Component
(ages ago). @Component
should be the only decorator you need.
这篇关于基于台式机或移动设备的Angular 2不同视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!