首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >角-全堆栈-无法添加模块

角-全堆栈-无法添加模块
EN

Stack Overflow用户
提问于 2017-09-14 20:34:02
回答 1查看 40关注 0票数 0

我一直在尝试将角图(http://jtblin.github.io/angular-chart.js/)模块添加到我的角度应用程序中,但是我一直收到错误消息:无法找到模块‘angt-chart.js’。

这就是我一直在做的

webpack.make.js

代码语言:javascript
复制
    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

代码语言:javascript
复制
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

代码语言:javascript
复制
<head>
  <script src="../node_modules/angular-chart.js/dist/angular-chart.min.js"></script>
</head>

任何提示将不胜感激,谢谢您的先进。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2017-09-15 10:55:15

看起来角图It没有导出它的模块名“chart.js”。

您必须编写类似于“chart.js”的依赖项:

代码语言:javascript
复制
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'])
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/46227824

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档