我正在将一个angular 4应用程序从bootstrap迁移到material-2。之前的版本使用的是基于bootstrap和font-awesome的bootstrap-social。它允许呈现以下内容:

呈现社交登录图标的angular-material2“方式”是什么?你不会把字体和bootstrap和素材混在一起吧?
发布于 2017-07-18 07:09:43
在Material 2中,除了Material Design Icons提供的图标外,还可以提供自己的图标。
import { Component } from '@angular/core';
import { DomSanitizer } from '@angular/platform-browser';
import { MdIconRegistry } from '@angular/material';
@Component({
selector: 'icon-usage',
templateUrl: 'icon.component.html',
styleUrls: ['icon.component.css']
})
export class IconComponent {
constructor(iconRegistry: MdIconRegistry, sanitizer: DomSanitizer) {
iconRegistry.addSvgIcon('angular', sanitizer.bypassSecurityTrustResourceUrl('/assets/angular-icon.svg'));
}
}点击这里查看:Angular Material 2 - Icons
另请参阅:Angular Material 2 - Typography
https://stackoverflow.com/questions/45106852
复制相似问题