• 欢迎访问搞代码网站,推荐使用最新版火狐浏览器和Chrome浏览器访问本网站!
  • 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏搞代码吧

Angular学习笔记之集成三方UI框架、控件的示例

angularjs 搞代码 4年前 (2021-12-31) 21次浏览 已收录 0个评论

这篇文章主要介绍了Angular学习笔记之集成三方UI框架、控件的示例,详细的介绍了Material UI、Ag-grid等框架,具有一定的参考价值,感兴趣的小伙伴们可以参考一下

本文介绍了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_<mark style="color:transparent">来源gaodaimacom搞#^代%!码网</mark>modules/@angular/material/prebuilt-themes/indigo-pink.css

or

style.css

 @import "~@angular/material/prebuilt-themes/indigo-pink.css"; 

step 4:

index.html

 

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框架、控件的示例的详细内容,更多请关注gaodaima搞代码网其它相关文章!


搞代码网(gaodaima.com)提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请说明详细缘由并提供版权或权益证明然后发送到邮箱[email protected],我们会在看到邮件的第一时间内为您处理,或直接联系QQ:872152909。本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:Angular学习笔记之集成三方UI框架、控件的示例

喜欢 (0)
[搞代码]
分享 (0)
发表我的评论
取消评论

表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址