0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

【Angular】mat-icon

0
Posted at

結論

  • mat-icon は、Angular Material で アイコンを表示するためのコンポーネント
  • よくbuttonタグの中に入れて使う

詳細

基本的な使い方

  • <mat-icon>{{文字列}}</mat-icon> →mat-iconはその文字列をアイコン名として解釈して対応する絵を表示してくれる
  • 例:
<button mat-icon-button (click)="deleteTodo()">
  <mat-icon>delete</mat-icon>
</button>

image.png

アイコンの色や大きさを変える

iconColor = 'red';
<mat-icon color="primary">home</mat-icon>
<mat-icon [style.color]="iconColor">favorite</mat-icon>

image.png

image.png

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?