我正在将angular 4
申请从bootstrap
移至material-2
。之前的版本使用bootstrap-social,它基于bootstrap和font-awesome
。它允许呈现以下内容:
angular-material2'方式'呈现社交登录图标? 人们不会将font-awesome和bootstrap与材料混合在一起吗?
答案 0 :(得分:1)
在材质2中,除了“材质设计图标”提供的图标外,您还可以提供自己的图标。
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