Deborak Kurata's Angular Routing APM-Start example used in her Pluralsight course converted to use Angular-CLI 1.0.0 and Angular 4.0.3
Deborak Kurata's Angular Routing Problem Solver
As of April 24, 2017, zone.js 0.8.8 and Angular 4.0.3 do not play nice togeher, so you need to upgrade zone.js to 0.8.9 as shown below:
cd yourProjectDirectory
npm install -S zone.js@0.8.9
The fix, in the form of zone.js 0.8.9, appeared on April 25, 2017.
I have learned the hard way to use the following for building the project:
ng build --verbose --progress --vendor-chunk --extract-css --prod
If you leave off --prod
, your build may not spot all of the errors in your project.
And yes, I will be the first to agree that putting --prod
on ng build
seems like overkill, but trust me, you want to find out from ng build --prod
what is wrong with your project, not from ng serve --prod
.
You will be amazed how many errors that ng build --prod
uncovers that ng build
remains blissfully unware of.
In fact, I routinely replace the default generated scripts
in package.json with these:
"build": "ng build --verbose --progress --vendor-chunk --extract-css",
"build-prod": "ng build --verbose --progress --vendor-chunk --extract-css --prod",
"start": "ng serve --open --verbose --vendor-chunk --extract-css",
"start-prod": "ng serve --open --verbose --vendor-chunk --extract-css --prod",
To get more help on the Angular CLI use ng help
or go check out the Angular CLI README.