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

查看:102
本文介绍了angular.js - angular2 中bootstrap指令和ng2-bootstrap这个有啥区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问 题

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

解决方案

别闹,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的指令封装集合

这篇关于angular.js - angular2 中bootstrap指令和ng2-bootstrap这个有啥区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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