javascript - Angular 2 CLI - 3rd party JS plugins lazy loading -
https://github.com/ocombe/oclazyload
i have used angular 1, there alternative plugins work angular 2? want include 3rd party javascript plugins on demand (lazy-load), angular 2 project. far no success.
i'm working on angular cli. have tried include in angular-cli.json
file, including jquery seems work. think global load.
"styles": [ "styles.css", "../node_modules/bootstrap/dist/css/bootstrap.css" ], "scripts": [ "../node_modules/jquery/dist/jquery.js" ],
let's want page wow.js
plugin in page. should call component wow.js initiated inside it, wow.js
file included dynamically. how that?
thanks
you add assets wow.js file in angular-cli.json configuration file.
"assets": [ "pathtoyourplugin/wow.js" ],
then component add script tag import library.
<script src="/wow.js"></script>
Comments
Post a Comment