angular2 中bootstrap指令和ng2-bootstrap这个有啥区别?

1.我的理解是,bootstrap指令只是ng2用来渲染页面的(其实和bootstrap没有半毛钱关系)。ng2-bootstrap这个则是基于angular2 的扩展?(不知道这么理解对不对)
2.bootstrap这个指令并不能用bootstrap的那些样式属性,以及js属性。
3.在angular2项目中加入了ng2-bootstrap这个扩展以后就可以使用bootstrap的那些属性了。
4.求大神指点解惑。

阅读 7.2k
3 个回答

别闹,angular2里的bootstrap是:

import {bootstrap} from '@angular/platform-browser-dynamic';

看文档:

Bootstrapping for Angular applications.

You instantiate an Angular application by explicitly specifying a component to use as the root component for your application via the `bootstrap()` method.

这个方法作为ng2应用的起始点,大致可以对应ng1里的bootstrap

你说的ng2-bootstrap,很显然,她是一个对UI库bootstrap的指令封装集合

新手上路,请多包涵

1:第一个bootstrap是angular的启动器,与ui没有关系。

2:第二个ng-bootstrap是适用于Angular2的bootstrap(ui+func),相当于Angular1.x的 Angular UI

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进