Angular 2 ng2-bootstrap datepicker systemjs 404 error -
i using datepicker ng2-bootstrap.
https://valor-software.com/ng2-bootstrap/#/datepicker
i have imported datepicker_directives in component
import { datepicker_directives } './../../../node_modules/ng2-bootstrap/components/datepicker';
added directives list
directives: [datepicker_directives],
and in template using this:
<datepicker [(ngmodel)]="dt" [mindate]="mindate" [showweeks]="true"></datepicker>
my systemjs configuration looks this:
var map = { 'app': 'content/app', 'rxjs': 'node_modules/rxjs', '@angular': 'node_modules/@angular', "angular2-masonry": "node_modules/angular2-masonry", 'datepicker': 'node_modules/ng2-bootstrap/components/datepicker' }; var paths = { "masonry-layout": "node_modules/masonry-layout/dist/masonry.pkgd.js", 'datepicker': 'node_modules/ng2-bootstrap/components/datepicker/datepicker.component.js', }; var packages = { 'app': { main: 'main.js', defaultextension: 'js' }, 'rxjs': { defaultextension: 'js' }, "angular2-masonry": { defaultextension: 'js', main: "index" }, 'datepicker': { defaultextension: 'js', main: "datepicker.component" } }; var angularpackages = [ '@angular/common', '@angular/compiler', '@angular/core', '@angular/http', '@angular/platform-browser', '@angular/platform-browser-dynamic', '@angular/router' ]; angularpackages.foreach(function (pkgname) { packages[pkgname] = { main: 'index.js', defaultextension: 'js' }; }); var config = { map: map, packages: packages, paths: paths }; system.config(config);
everything compiles without error, when run in browser displays below error in console:
/content/node_modules/ng2-bootstrap/components/datepicker 404 (not found)
i not sure why still searching datepicker in /content/node_modules/ng2-bootstrap/components/datepicker, have specified in node_modules/ng2-bootstrap/components/datepicker.
you have make sure include ng2-bootstrap library in index.html:
<script src="node_modules/ng2-bootstrap/bundles/ng2-bootstrap.min.js"></script>
Comments
Post a Comment