我一直在尝试将角图(http://jtblin.github.io/angular-chart.js/)模块添加到我的角度应用程序中,但是我一直收到错误消息:无法找到模块‘angt-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>任何提示将不胜感激,谢谢您的先进。
发布于 2017-09-15 10:55:15
看起来角图It没有导出它的模块名“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'])https://stackoverflow.com/questions/46227824
复制相似问题