Twitter bootstrap 在angular material 2中使用社交图标2
我正在将Twitter bootstrap 在angular material 2中使用社交图标2,twitter-bootstrap,angular-material2,Twitter Bootstrap,Angular Material2,我正在将angular 4应用程序从bootstrap移动到material-2。以前的版本使用的是基于引导和font-awesome。它允许呈现以下内容: 呈现社交登录图标的“方式”是什么? 人们不会将字体和引导与材质混合使用?在材质2中,除了材质设计图标提供的图标外,您还可以提供自己的图标 import { Component } from '@angular/core'; import { DomSanitizer } from '@angular/platform-browser';
angular 4
应用程序从bootstrap
移动到material-2
。以前的版本使用的是基于引导和font-awesome
。它允许呈现以下内容:
呈现社交登录图标的“方式”是什么?
人们不会将字体和引导与材质混合使用?在材质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'));
}
}
请看这里:
另请参见:在材质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'));
}
}
请看这里:
另见: