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
Asked
Active
Viewed 1,292 times
-3
-
1make use of structural directives *ngIf or even parent child components , there are multiple ways to achieve it . its too broad a question to answer i feel – Rahul Singh Sep 04 '17 at 09:41
-
@RahulSingh : Thanks – Supreet Sep 04 '17 at 09:49
1 Answers
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