Angular2 ng2-bootstrap
在将bootstrap添加到我的angular2项目时遇到了一些麻烦.
I'm having some trouble adding bootstrap to my angular2 project.
如 https://valor-software.com/ng2-bootstrap/上所述我已经通过npm install --save ng2-bootstrap
将ng-bootstrap安装到node-modules目录(moment
包含在同一目录中).
As documented on https://valor-software.com/ng2-bootstrap/ I've installed ng-bootstrap to the node-modules directory by npm install --save ng2-bootstrap
(moment
is included in the same directory).
添加
import {Component, ChangeDetectionStrategy} from '@angular/core';
import {CORE_DIRECTIVES} from '@angular/common';
import {TAB_DIRECTIVES} from '@ng2-bootstrap';
导致以下错误error TS2307: Cannot find module '@ng2-bootstrap'.
还将路径从'../../../ng2-bootstrap'
更改为'@ng2-bootstrap'
.
leads to the following error error TS2307: Cannot find module '@ng2-bootstrap'.
Also changed the path from '../../../ng2-bootstrap'
to '@ng2-bootstrap'
.
两者都不起作用.有任何解决方法的想法吗?
Both did not work. any ideas how to fix it?
更新:这是一篇有趣的文章,介绍如何使用ng-cli
将最新版本4 Alpha引导到您的Angular项目中. https://angularjs.de/artikel/angular2-bootstrap-scss-angular-cli
UPDATE: Here's an interesting article on how to implement bootstraps latest version 4 Alpha into your angular project with ng-cli
. https://angularjs.de/artikel/angular2-bootstrap-scss-angular-cli