Angular2 with modernizr

半腔热情 提交于 2019-12-01 18:21:47
Ram

Follow the steps -

  1. Place the type definition of Modernizr into your project folder.

  2. Place the modernizr.js in your project and access it within any component using relative path like - import './Lib/modernizr.js';

Done!! You should be able to use the modernizr to detect browser feature support.

You would just need to include the Modenrizr file in your page, above any of your angular code. It will register itself on the page, and you will be able to access the global Modernizr object. No further integration should be nessecary

Import modernizr like below in your ts file and use it :)

import * as Modernizr from 'modernizr';

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!