Angular2 Installing 3rd party plugin with Angular-cli -
my angular-cli's angular 2 version 2.0.0-rc.1. trying install angular2-grid , followed exact way described in tutorial, shwos me error.
zone.js:101 http://localhost:4200/node_modules/angular2-grid/dist/nggrid 404 (not found)scheduletask @ zone.js:101zonedelegate.scheduletask @ zone.js:336zone.schedulemacrotask @ zone.js:273(anonymous function) @ zone.js:122send @ vm6591:3fetchtextfromurl @ system.src.js:1154(anonymous function) @ system.src.js:1735zoneawarepromise @ zone.js:584(anonymous function) @ system.src.js:1734(anonymous function) @ system.src.js:2759(anonymous function) @ system.src.js:3333(anonymous function) @ system.src.js:3600(anonymous function) @ system.src.js:3985(anonymous function) @ system.src.js:4448(anonymous function) @ system.src.js:4700(anonymous function) @ system.src.js:406zonedelegate.invoke @ zone.js:323zone.run @ zone.js:216(anonymous function) @ zone.js:571zonedelegate.invoketask @ zone.js:356zone.runtask @ zone.js:256drainmicrotaskqueue @ zone.js:474zonetask.invoke @ zone.js:426 zone.js:461 unhandled promise rejection: error: xhr error (404 not found) loading http://localhost:4200/node_modules/angular2-grid/dist/nggrid @ xmlhttprequest.wrapfn [as _onreadystatechange] (http://localhost:4200/vendor/zone.js/dist/zone.js:769:30) @ zonedelegate.invoketask (http://localhost:4200/vendor/zone.js/dist/zone.js:356:38) @ zone.runtask (http://localhost:4200/vendor/zone.js/dist/zone.js:256:48) @ xmlhttprequest.zonetask.invoke (http://localhost:4200/vendor/zone.js/dist/zone.js:423:34) error loading http://localhost:4200/node_modules/angular2-grid/dist/nggrid "angular2-grid" http://localhost:4200/app/banbeis.component.js ; zone: <root> ; task: promise.then ; value: error: error: xhr error (404 not found) loading http://localhost:4200/node_modules/angular2-grid/dist/nggrid(…)consoleerror @ zone.js:461_loop_1 @ zone.js:490drainmicrotaskqueue @ zone.js:494zonetask.invoke @ zone.js:426 zone.js:463 error: uncaught (in promise): error: error: xhr error (404 not found) loading http://localhost:4200/node_modules/angular2-grid/dist/nggrid(…)
i ran thier demo example ,it worked after tried angular-cli no hard luck yet. working code appreciable :)
i fixed of btmorton(author of angular2-grid), opened issue in angular2-grid github . posting solution here.
in angular-cli-build.js , have make way
... vendornpmfiles: [ ... 'angular2-grid/dist/**/*.js' ...
in system-configs.ts
/** map relative paths urls. */ const map: = { 'angular2-grid': 'vendor/angular2-grid/dist' }; /** user packages configuration. */ const packages: = { 'angular2-grid': { main: 'main.js', defaultextension: 'js' } };
the cli weird bundling, hence many error.