angular-fullstack - 无法添加模块

angular-fullstack - unable to add modules

我一直在尝试将 angular-chart (http://jtblin.github.io/angular-chart.js/) 模块添加到我的 angular 应用程序,但我一直收到错误消息:找不到模块 'angular-chart.js'.

这就是我一直在做的事情:

webpack.make.js

    if(TEST) {
    config.entry = {};
} else {
    config.entry = {
        app: './client/app/app.ts',
        polyfills: './client/polyfills.ts',
        vendor: [
            'angular',
            'angular-animate',
            'angular-aria',
            'angular-cookies',
            'angular-resource',
            'angular-route',
            'angular-sanitize',
            'angular-ui-bootstrap',
            'lodash',
            'angular-chart'
        ]
    };
}

app.ts

import chart from 'angular-chart.js';

angular.module('mmcApp', [ngCookies, ngResource, ngSanitize, ngRoute, 
uiBootstrap, _Auth, account, admin, 'validation.match', navbar, 
footer, main, constants, graphs, about, chart])

_index.html

<head>
  <script src="../node_modules/angular-chart.js/dist/angular-chart.min.js"></script>
</head>

如有任何提示,我们将不胜感激,在此先致谢。

似乎angular-chart.js没有导出它的模块名称'chart.js'。

你必须像'chart.js'这样写依赖:

import 'angular-chart.js';

angular.module('mmcApp', [ngCookies, ngResource, ngSanitize, ngRoute, 
uiBootstrap, _Auth, account, admin, 'validation.match', navbar, 
footer, main, constants, graphs, about, 
'chart.js'])