app.component.ts
import { Component } from '@angular/core';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
counter: number = 0;
updateCounter(){
this.counter++;
}
}
app.component.html
<h2>Angular Material - How to use stroked Button</h2>
<h1>{{counter}}</h1>
<div style="display:flex; justify-content:space-between;
padding:20px;background-color:gray;">
<button mat-stroked-button (click)="updateCounter()">
Basic Button
</button>
<button mat-stroked-button color="primary"
(click)="updateCounter()">
Primary Color
</button>
<button mat-stroked-button color="accent"
(click)="updateCounter()">
Accent Color
</button>
</div>
<div style="display:flex; justify-content:space-between;
padding:20px; background-color:gray;">
<button mat-stroked-button color="warn"
(click)="updateCounter()">
Warn
</button>
<a mat-stroked-button href="https://www.android--code.com/"
target="_blank">
Link Button
</a>
</div>
<div style="padding:20px; background-color:gray;">
<button mat-stroked-button disabled
(click)="updateCounter()">
Disabled Button
</button>
</div>
app.module.ts [import]
import {MatButtonModule} from '@angular/material/button';
- angular bootstrap - Popover with HTML content
- angular bootstrap - How to delay Popover open close
- angular bootstrap - Popover manual triggers
- angular bootstrap - How to show footer in Datepicker
- angular bootstrap - Datepicker popup position & target
- angular bootstrap - How to collapse Accordion all panels
- angular bootstrap - Accordion panel custom header
- angular bootstrap - How to use Nav without ul li
- angular bootstrap - How to show vertical pills in a Nav
- angular material - How to use basic Button
- angular material - How to use raised Button
- angular material - How to use flat Button
- angular material - How to use icon Button
- angular material - How to use FAB
- angular material - How to use mini FAB