Angular2 ng2-bootstrap [英] Angular2 ng2-bootstrap

查看:81
本文介绍了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

这篇关于Angular2 ng2-bootstrap的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆