Angular学习笔记之集成三方UI框架、控件的示例
2018-03-23 11:46
1821 查看
本文介绍了Angular学习笔记之集成三方UI框架、控件的示例,分享给大家,具体如下:
安装 Material UI 方法:
Material 官网: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 href="https://fonts.googleapis.com/icon?family=Material+Icons" 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 官网: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 官网: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 的内容
注意:在根 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" ]
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持脚本之家。
您可能感兴趣的文章:
相关文章推荐
- Angular学习笔记之集成第三方UI框架、组件
- SMP3.0学习笔记之十一 与第三方HTML5框架(例如Sencha Touch)集成
- android菜鸟学习笔记13----Android控件(二) 自定义控件简单示例
- No.1 iOS---UI学习第一天(笔记)(以及为什么模拟器上不显示我们添加的控件的解决办法)
- ios学习笔记第三天之UI控件
- iOS学习笔记—— UIPickerView 控件的简单使用
- Android Studio Android UI控件学习笔记
- 学习笔记 Bootstrap 第一天--UI框架
- 多线程学习笔记之更新UI控件(转载)
- [Android新手学习笔记17]-UI控件之ProgressDialog
- IOS入门学习笔记(普通UI控件--UIButton)
- IOS学习笔记(七)之UISegmentedControl分段控件的基本概念和使用方法
- IOS学习笔记(七)之UISegmentedControl分段控件的基本概念和使用方法
- iOS学习笔记43——iOS6下自定义UI控件外观效果
- 【初学】UI控件学习笔记-UIButton按钮控件详细介绍
- VS2010 C++ MFC框架学习笔记3 - 控件Tab顺序设置及模态对话框
- [Android新手学习笔记11]-UI控件之TextView
- Angular-UI-Router 学习笔记
- 【初学】UI控件学习笔记-UILable制作打字机特效(lable+array+timer+动态string)
- java安全框架-Shiro学习笔记(五)-Shiro集成Web