Issue
I have a component name "personal-info" which is the subform of page_a and page_b.
// PAGE_A
.......
<div>
<app-personal-info formControlName="personalInfo"></app-personal-info>
</div>
......
// PAGE_B
.......
<div>
<app-personal-info formControlName="personalInfo"></app-personal-info>
</div>
......
How do I know from personal-info component that a call is being made from page_a OR page_b so that i can chance the behavior/appearance of personal-info based on the calling page.
Solution
Best way is pass an Input
from pages
Like
<app-personal-info formControlName="personalInfo" [pageName]="'page1'"></app-personal-info>
And handle it in your component's TS file
Answered By - Kenny
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.