user11189233
user11189233

Reputation:

Loading component on button click in Angular7

How can I make edit button work in a data table in angular 7. I would also like to know how to load a component on button click,

Upvotes: 0

Views: 279

Answers (1)

Gvs Akhil
Gvs Akhil

Reputation: 2591

Ok here is my idea to acheive it

First for a button to work we use (click)

<button (click)="toggledata()">Show</button>
<demo-component *ngIf="value"></demo-component>

.ts

value = false;

toggledata() {
 this.value = !this.value;
}

Upvotes: 0

Related Questions