Angular学习笔记之集成三方UI框架、控件的示例
本文介绍了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" ]
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持脚本之家。
相关文章
AngularJS基础 ng-mouseleave 指令详解
本文主要介绍AngularJS ng-mouseleave 指令,这里帮大家整理了ng-mouseleave指令的详细资料,并附有代码示例,有需要的小伙伴可以参考下2016-08-08angularjs过滤器--filter与ng-repeat配合有奇效
本篇文章主要介绍了angularjs过滤器-filter与ng-repeat的相关知识。具有很好的参考价值。下面跟着小编一起来看下吧2017-04-04Angular.js ng-file-upload结合springMVC的使用教程
这篇文章主要给大家介绍了关于Angular.js文件上传控件ng-file-upload结合springMVC的使用教程,文中通过示例代码介绍的非常详细,对大家具有一定的参考学习价值,需要的朋友们下面来一起看看吧。2017-07-07Angularjs渲染的 using 指令的星级评分系统示例
本篇文章主要介绍了Angularjs渲染的 using 指令的星级评分系统示例,小编觉得挺不错的,现在分享给大家,也给大家做个参考。一起跟随小编过来看看吧2017-11-11AngularJS的依赖注入实例分析(使用module和injector)
这篇文章主要介绍了AngularJS的依赖注入,结合实例形式分析了依赖注入的原理及使用module和injector实现依赖注入的步骤与操作技巧,需要的朋友可以参考下2017-01-01Angular中ng-repeat与ul li的多层嵌套重复问题
这篇文章主要介绍了Angular中ng-repeat与ul li的多层嵌套重复问题,需要的朋友可以参考下2017-07-07
最新评论