【问题标题】:angular2 final release ng-bootstrap component not found 404angular2 最终版本 ng-bootstrap 组件未找到 404
【发布时间】:2016-09-21 15:01:04
【问题描述】:

angular2 最终版本。 ng-bootstrap alpha v.5

bootstrap 组件适用于 html,但是当我尝试按以下方式导入它们时

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

我收到以下错误。

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)

当然看起来它正在尝试从不存在的捆绑包中加载下拉列表。捆绑包只包含 ng-bootstrap.js 'dropdown' 是捆绑包之外的不同组件。我认为它与 systemjs.config.js 有一些关系,有人可以帮忙吗?

以下是我的 systemjs.config.js 文件

(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);

【问题讨论】:

    标签: angular ng-bootstrap


    【解决方案1】:

    已向 ng-bootstrap 团队报告,这是他们创建的问题

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-03-10
      • 2017-01-04
      • 2013-04-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-11-12
      • 1970-01-01
      相关资源
      最近更新 更多