I'm a newcomer to Angular and I have an issue that requires a neat solution:
I have a div element called "SelectedList" that needs to display a list of active elements from another container. This container contains two tabs, Tab1 and Tab2, which are populated by $scope.model1 and $scope.model2 respectively. When Element1 is selected in Tab1, it should be added to "SelectedList". If Element2 is then selected in Tab2, it should appear in "SelectedList" below Element1.
One way to approach this is to create a temporary model by combining $scope.model1 and $scope.model2 into $scope.selectedList and use:
<ul id="SelectedList" ng-repeat="listItem in selectedList">...</ul>
However, I am exploring if there's a cleaner method that supports two-way data binding, like:
<ul id="SelectedList" ng-repeat="listItem in model1 + model2">...</ul>
Are there better solutions for this scenario? Perhaps a completely different approach altogether?