How to add ng-bootstrap to an Angular-CLI (Broccoli version) project?

后端 未结 2 764
暗喜
暗喜 2021-01-03 03:32

How to add ng-bootstrap (by written by the angular-ui team) to an Angular-CLI (Angular2 RC4) project?

More specifically:

  1. How should I add
2条回答
  •  青春惊慌失措
    2021-01-03 04:22

    Yes well answered by @pd farhad above but I want to give some explanation to that one,

    Actually if you have to add some third party libraries in angular CLI then you must have to add that third party library reference in the angular-cli-build.js file , because angular cli took all files from the vendor folder instead of node_modules folder so whenever you add entry for your library (say ng-bootstrap in your case) in cli-build file. it will make copy of that library in the vendor folder of angular cli. which is available to our project. so

    How should I add the minified .css from my node_modules folder to my angular-cli project?

    you have to give reference of that file/library in the system-cli-build.js file in order to get in the vendor folder.

    Do I have to add it to angular-cli-build.js

    yes, its compulsory if it is a library, but not in case of a just single file then you can drop that file into public folder too. its depends on you.

    Do I have to add the typings?

    Not that much compulsory.

    hope this clears more!

提交回复
热议问题