欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

ng2學(xué)習(xí)筆記之bootstrap中的component使用教程

 更新時間:2017年03月09日 09:05:56   作者:Benson.Cai  
現(xiàn)在angular2已經(jīng)除了集成的angular-cli,建議大家可以基于這個來快速開發(fā)ng2的項目,不用自己再搭建環(huán)境。接下來通過本文給大家介紹 bootstrap中的component使用教程,需要的朋友可以參考下

 前序:

現(xiàn)在angular2已經(jīng)除了集成的angular-cli,建議大家可以基于這個來快速開發(fā)ng2的項目,不用自己再搭建環(huán)境;

相關(guān)內(nèi)容請前往:https://angular.cn/docs/ts/latest/cli-quickstart.html

正文:

以圖片輪播組件carousel為例:

首先安裝好ng2-bootstrap,bootstrap

npm install ng2-bootstrap bootstrap --save

在需要用到的模塊中導(dǎo)入

import { CarouselModule } from 'ng2-bootstrap'
@NgModule({
 imports: [
  CarouselModule.forRoot()
 ],
})
export class HeaderModule { }

然后,有很重要一點(diǎn),不要忘記引入了bootstroop.min.css文件;

接著,在組件的html中寫入

<carousel [interval]="myInterval" [noWrap]="noWrapSlides" [(activeSlide)]="activeSlideIndex">
 <slide *ngFor="let slidez of slides;">
  <img [src]="slidez" >
 </slide>
</carousel>

以上所述是小編給大家介紹的ng2學(xué)習(xí)筆記之bootstrap中的component使用教程,希望對大家有所幫助,如果大家有任何疑問請給我留言,小編會及時回復(fù)大家的。在此也非常感謝大家對腳本之家網(wǎng)站的支持!

相關(guān)文章

最新評論