-3

I am a beginner in Angular and facing an issue in development. In my application displaying data of customer in grid and on clicking row a div under this row will expand and customer related detailed data will be displayed in that div. I want to hit the database on click and then data will bind to the template and then that HTML will be injected under clicked row. I have no idea how to do this. Please suggest. Thanks

Rohan Fating
  • 2,135
  • 15
  • 24
Supreet
  • 2,451
  • 8
  • 25
  • 42

1 Answers1

1

You can use *ngIf directive, as the documentation states:

Conditionally includes a template based on the value of an expression

ngIf evaluates the expression and then renders the then or else template in its place when expression is truthy or falsy respectively. Typically the:

  • then template is the inline template of ngIf unless bound to a different value.
  • else template is blank unless it is bound.

Check this for better understanding.

Peter
  • 10,492
  • 21
  • 82
  • 132