HI create the responsive header button with Angular 18 with below code. It alway return false. I don’t know how. Could you help me.
the handsetView$ returns the object like {screen: “sm”, cols: 1}
`<div class="header-button">
@if (handsetView$ | async; as view) {
@if (view.cols === 1) {
<div>
<button mat-icon-button color="primary" (click)="addNewTeam()">
<mat-icon>add</mat-icon>
</button>
<button mat-button color="primary" (click)="addNewTeam()">
<mat-icon>edit</mat-icon>
</button>
</div>
} @else {
<p>Not content</p>
}
}
</div>`
@if condition always return false
New contributor
Nguyen Quyen is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.