亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

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

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

 前序:

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

相關(guān)內(nèi)容請(qǐng)前往: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使用教程,希望對(duì)大家有所幫助,如果大家有任何疑問請(qǐng)給我留言,小編會(huì)及時(shí)回復(fù)大家的。在此也非常感謝大家對(duì)腳本之家網(wǎng)站的支持!

相關(guān)文章

最新評(píng)論