Это мои 3 примера:
Для иконок, которые я установил: npm i material-icons
Затем я импортировал материал в style.css: @import '~ material-icons / iconfont/material-icons.css';
app.component.html
//text button
<app-button-icon-text [text]="'test'"></app-button-icon-text>
<br><br>
//iconbutton
<app-button-icon-text [icon]="'face'"></app-button-icon-text>
<br><br>
//icon + text button
<app-button-icon-text [text]="'test'" [icon]="'face'"></app-button-icon-text>
button-icon-text.component.html
<button>
<span *ngIf="icon" class="material-icons">{{icon}}</span>
{{text}}
</button>
button-icon-text.component.html
import {Component, Input, OnInit} from '@angular/core';
@Component({
selector: 'app-button-icon-text',
templateUrl: './button-icon-text.component.html',
styleUrls: ['./button-icon-text.component.css']
})
export class ButtonIconTextComponent implements OnInit {
@Input()
text;
@Input()
icon;
constructor() {
}
ngOnInit() {
}
}