I created an app with angular-cli and I need to import external libraries such as underscore. I'm new to angular 2.4 and haven't used SystemJS nor Webpack before. Can someone give me a step by step guid of how to load underscore into my angular 2.4 project.
A link to github with a project created with angular-cli "latest version" with underscore would make me super happy. Reading code is nice ;)
---- Following is just to describe what makes me confused ------
From my research I found 2 alternatives to load modules.
- SystemJS - Most documented in angular.io
- Webpack - Is what angular-cli is using.
Which one is best to use?
//package.json
"name": "angular",
"version": "0.0.0",
"license": "MIT",
"angular-cli": {},
"scripts": {
"ng": "ng",
"start": "ng serve",
"test": "ng test",
"pree2e": "webdriver-manager update --standalone false --gecko false",
"e2e": "protractor"
}
The cli creates a reference to "ng serve" in the script tag. Should I remove that line and replace it with webpack?
... If so. Do I have to set up all the settings angular already done plus mine or is it an easier way you just add my settings on top?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…