I am developing a dashboard with angular js (Angular 1.5). In my parent interface(Interface A), on a button click it needed to be popped an update user information form(Interface B). Popping up a form works fine.
But my problem is, I need to make it fill the details of that update form(Interface B) if the data is already there in the DB. DB query which is in the controller of Interface B; needs a parameter in interface B to retrieve data(That parameter changes time to time).
So my problem is, if I use "ng-init=myfunction()" in the code of Interface B, it gives undefined because the needed parameter is only instantiated on the button click of Interface A ; to pop the update form (Interface B). If I use ng-onload instead, it doesn't give any relevant output.
As I did not have a proper mechanism for this, what I did was to add another button on my interface B, So that on the button click(ng-click) event I could call my function to retrieve data to my form.
Please help me with this issue.
Thank you in advance.
Try this