I've a screen in below structure.
UserExperienceScreen
<tabset>
tab 1 - <controller> <form> - input fields - form submit - go to tab2
tab 2 - <controller1> <form> - populate other details based on the tab1 information - form submit - go to tab3
tab 3 - ....
</tabset>
I'm not able to get access the input field values entered in first tab from second tab. If i move the code out of the tabset it works fine. given plunker below.
what am i doing wrong? it would be greatful if the screen have only one controller and share model across tabs.
Plunker Code: http://plnkr.co/edit/MZdELPvnaFp9pRvgJHVd?p=preview
It is not advisable to pollute the
$rootScope
like this, instead you can either share a common servce data across your controllers or simply use one controller for all your tabs, such as the following:[1] Share a common service data across your controllers:
DEMO
JAVASCRIPT
HTML
[2] Use one controller for all your tabs
DEMO
JAVASCRIPT
HTML