Angular學(xué)習(xí)筆記之集成三方UI框架、控件的示例
本文介紹了Angular學(xué)習(xí)筆記之集成三方UI框架、控件的示例,分享給大家,具體如下:
安裝 Material UI 方法:
Material 官網(wǎng):https://material.angular.io
step 1:
npm install --save @angular/material @angular/cdk
step 2:
npm install --save @angular/animations
step 3:
angular.cli
../node_modules/@angular/material/prebuilt-themes/indigo-pink.css
or
style.css
@import "~@angular/material/prebuilt-themes/indigo-pink.css";
step 4:
index.html
<link rel="external nofollow" rel="stylesheet">
step 5:
app.module.ts import {MatInputModule, MatCardModule, MatButtonModule} from "@angular/material"; import {BrowserAnimationsModule} from '@angular/platform-browser/animations'; imports:[ BrowserAnimationsModule, MatInputModule, MatCardModule, MatButtonModule, ]
安裝 Ag-grid 的方法
Ag-grid 官網(wǎng):https://www.ag-grid.com/
step 1:
npm install --save ag-grid-angular ag-grid
step 2:
angular.cli
"../node_modules/ag-grid/dist/styles/ag-grid.css", "../node_modules/ag-grid/dist/styles/ag-theme-fresh.css"
step 3:
app.module.ts
imports:[ AgGridModule.withComponents([]) ], exports:[ AgGridModule ]
安裝 NG-ZORRO 的方法
NG-ZORRO 官網(wǎng):https://ng.ant.design/version/0.7.x/docs/introduce/zh
step 1:
npm install ng-zorro-antd --save
step 2:
直接用下面的代碼替換 /src/app/app.module.ts 的內(nèi)容
注意:在根 module 中需要使用 NgZorroAntdModule.forRoot(),在子 module 需要使用 NgZorroAntdModule
import { BrowserModule } from '@angular/platform-browser'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { NgModule } from '@angular/core'; import { FormsModule } from '@angular/forms'; import { HttpClientModule } from '@angular/common/http'; import { NgZorroAntdModule } from 'ng-zorro-antd'; import { AppComponent } from './app.component'; @NgModule({ declarations: [ AppComponent ], imports: [ BrowserModule, FormsModule, HttpClientModule, BrowserAnimationsModule, NgZorroAntdModule.forRoot() ], bootstrap: [AppComponent] }) export class AppModule { }
step 3:
修改 .angular-cli.json 文件的 styles 列表
"styles": [ "../node_modules/ng-zorro-antd/src/ng-zorro-antd.less" ]
以上就是本文的全部?jī)?nèi)容,希望對(duì)大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。
相關(guān)文章
angularjs使用directive實(shí)現(xiàn)分頁(yè)組件的示例
本篇文章主要介紹了angularjs使用directive實(shí)現(xiàn)分頁(yè)組件的示例,具有一定的參考價(jià)值,有興趣的可以了解一下。2017-02-02angular 表單驗(yàn)證器驗(yàn)證的同時(shí)限制輸入的實(shí)現(xiàn)
表單驗(yàn)證是經(jīng)常用到一個(gè)東西,這篇文章主要介紹了angular 表單驗(yàn)證器驗(yàn)證的同時(shí)限制輸入的實(shí)現(xiàn),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2019-04-04angular中的http攔截器Interceptors的實(shí)現(xiàn)
本篇文章主要介紹了angular中的http攔截器Interceptors的實(shí)現(xiàn)的相關(guān)資料,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下。2017-02-02解決ng-repeat產(chǎn)生的ng-model中取不到值的問(wèn)題
今天小編就為大家分享一篇解決ng-repeat產(chǎn)生的ng-model中取不到值的問(wèn)題,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。一起跟隨小編過(guò)來(lái)看看吧2018-10-10深究AngularJS如何獲取input的焦點(diǎn)(自定義指令)
本篇文章主要介紹了AngularJS如何獲取input的焦點(diǎn)(自定義指令),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2017-06-06