I've recently switched markup in few of the forms to use angularJS ui Tabs component. The markups looks like this:
<div class="col-lg-3 col-md-3 panel-container">
<tabset vertical="true" type="pills">
<tab heading="@Labels.general" select="selectView('general')" >
</tab>
<tab heading="@Labels.passes" select="selectView('guestPasses')">
</tab>
<tab heading="@Labels.history" select="selectView('guestActivity')">
</tab>
<tab heading="@Labels.userDefined 1"
select="selectView('userDefined1')" >
</tab>
<tab heading="@Labels.userDefined 2"
select="selectView('userDefined2')" >
</tab>
</tabset>
</div>
<div class="col-lg-9 col-md-9 panel-container">
<div data-ui-view data-autoscroll="false"></div>
<div data-ui-view="guestPasses" data-autoscroll="false"></div>
</div>
and the controller's code to select a view is the following:
$scope.selectView = function (viewName) {
if ($scope.isNew) {
$state.go('new.' + viewName);
}
else {
$state.go('edit.' + viewName);
}
};
All seems to work well except for this change in behavior comparing with the original implementation - if I make invalid input in one of the controls, switch to another tab, then back, that bad input is gone. The valid input is preserved. I am wondering if it's possible to keep the invalid input this way or not?