I am facing an issue with a partial view that appears like this:
<div ng-if="activeItem.typeOf == 'text'">
<div onload="item=activeItem" ng-include="'views/app-builder/text.html'"></div>
</div>
Whenever a user clicks a button, I have a controller method that resets the activeItem.
$scope.showDetails = function(item){
$scope.activeItem = item;
};
The structure of activeItem is as follows:
{ name: "Candy", typeOf: "text" }
Initially, everything works fine. However, after the first time, the nested partial's active item is not updated because the reference in onload
remains unchanged. What would be the correct approach to address this issue in Angular?