Loading component on button click in Angular7

273 views Asked by At

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,

1

There are 1 answers

0
Gvs Akhil On

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;
}