在角材料中使用社交图标2

时间:2017-07-14 15:38:06

标签: twitter-bootstrap angular-material2

我正在将angular 4申请从bootstrap移至material-2。之前的版本使用bootstrap-social,它基于bootstrap和font-awesome。它允许呈现以下内容:

social icons

angular-material2'方式'呈现社交登录图标? 人们不会将font-awesome和bootstrap与材料混合在一起吗?

1 个答案:

答案 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

另见:Angular Material 2 - Typography