d-man
d-man

Reputation: 58113

angular2 final release ng-bootstrap component not found 404

angular2 final release. ng-bootstrap alpha v.5

bootstrap components works on html, but when i tried to import them as following

import {ViewChild} from "@angular/core/src/metadata/di";
import {NgbDropdown} from "@ng-bootstrap/ng-bootstrap/dropdown/dropdown”;

i got following error.

zone.js:136drainMicroTaskQueue @ zone.js:368ZoneTask.invoke @ zone.js:308
zone.js:1274 GET http://localhost:8080/abc/node_modules/@ng-bootstrap/ng-bootstrap/bundles/ng-bootstrap.js/dropdown/dropdown.js 404 (Not Found)

certainly looks like it is trying to load dropdown from bundles which is not there.. bundle just contains ng-bootstrap.js 'dropdown' is different component outside the bundle. I think it has to some thing with systemjs.config.js can some one help ?

Following is my systemjs.config.js file

(function (global) {

  System.config({
    paths: {
      // paths serve as alias
      'npm:': 'node_modules/'
    },
    // map tells the System loader where to look for things
    map: {
      // our app is within the app folder
      app: 'app',
      // angular bundles
      '@angular/core': 'npm:@angular/core/bundles/core.umd.js',
      '@angular/common': 'npm:@angular/common/bundles/common.umd.js',
      '@angular/compiler': 'npm:@angular/compiler/bundles/compiler.umd.js',
      '@angular/platform-browser': 'npm:@angular/platform-browser/bundles/platform-browser.umd.js',
      '@angular/platform-browser-dynamic': 'npm:@angular/platform-browser-dynamic/bundles/platform-browser-dynamic.umd.js',
      '@angular/http': 'npm:@angular/http/bundles/http.umd.js',
      '@angular/router': 'npm:@angular/router/bundles/router.umd.js',
      '@angular/forms': 'npm:@angular/forms/bundles/forms.umd.js',

      'rxjs':                       'npm:rxjs',
      'angular2-in-memory-web-api': 'npm:angular2-in-memory-web-api',
      '@ng-bootstrap/ng-bootstrap':'npm:@ng-bootstrap/ng-bootstrap/bundles/ng-bootstrap.js',
    },
    // packages tells the System loader how to load when no filename and/or no extension
    packages: {
      app: {
        main: './main.js',
        defaultExtension: 'js'
      },
      rxjs: {
        defaultExtension: 'js'
      },
      'angular2-in-memory-web-api': {
        main: './index.js',
        defaultExtension: 'js'
      },
      '@ng-bootstrap':{
        defaultExtension: 'js'
      },
      '@ng-bootstrap/ng-bootstrap':{
        defaultExtension: 'js'
      }
    }
  });
})(this);

Upvotes: 1

Views: 1602

Answers (1)

d-man
d-man

Reputation: 58113

reported to ng-bootstrap team, its a bug they created a issue

https://github.com/ng-bootstrap/ng-bootstrap/issues/779

Upvotes: 1

Related Questions