在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):Templarian/MaterialDesign-Angular-Material开源软件地址(OpenSource Url):https://github.com/Templarian/MaterialDesign-Angular-Material开源编程语言(OpenSource Language):JavaScript 100.0%开源软件介绍(OpenSource Introduction):
Angular Material - Material Design IconsAngular Material distribution for the Material Design Icons. InstallationInstall npm install @mdi/angular-material @angular/cdk UsageThis bundle is usable with AngularJS Material/Angular Material and to facilitate usage, it's recommended to use
Add the following plugin configuration in the Webpack configuration: new CopyWebpackPlugin([
{ from: 'node_modules/@mdi/angular-material/mdi.svg',
to: 'assets/mdi.svg'
}
]); Or if you're using the Angular CLI, make sure to include
Note that the input directory is dependent on the workspace root which can be found
by looking at your desired project's Additionally, see the Angular documentation on assets configuration for more information. Note: Documentation for Angular CLI versions 1.x.x (around Angular v5) has been dropped as Angular v5 is no longer supported. Angular MaterialThe
import { BrowserModule } from '@angular/platform-browser';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { NgModule } from '@angular/core';
import { MatIconRegistry, MatIconModule } from '@angular/material/icon';
import { DomSanitizer } from '@angular/platform-browser';
import { HttpClientModule } from '@angular/common/http';
// ...
@NgModule({
imports: [
BrowserModule,
BrowserAnimationsModule,
// Required by the Angular Material icon module
HttpClientModule,
// ...
MatIconModule
]
})
export class AppModule {
constructor(matIconRegistry: MatIconRegistry, domSanitizer: DomSanitizer){
matIconRegistry.addSvgIconSet(
domSanitizer.bypassSecurityTrustResourceUrl('./assets/mdi.svg')
);
}
}
<mat-icon svgIcon="<name of icon>"></mat-icon> For more information about SVG icons, check out the documentation. AngularJS MaterialThe var app = angular.module('myApp', ['ngMaterial']);
app.config(function($mdIconProvider) {
$mdIconProvider
.defaultIconSet('assets/mdi.svg')
}); Usage<md-icon md-svg-icon="android"></md-icon>
<md-button aria-label="Android" class="md-icon-button">
<md-icon md-svg-icon="android"></md-icon>
</md-button> Related Packages
Learn More |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论