After exploring the Angular Bootstrap UI and focusing on the $modal
service, I came across an intriguing discovery.
In their demo at 'http://plnkr.co/edit/E5xYKPQwYtsLJUa6FxWt?p=preview', the controller attached to the popup window contains an interesting approach where they nest the selected item within an inner property.
$scope.selected = {
item: $scope.items[0]
};
instead of simply
$scope.selected = $scope.items[0];
Surprisingly, their code performs as expected while mine does not.
Why is this necessary? What potential JavaScript pitfall is present here?
Thanks