On two occasions I will have to open a modal like this:
<code> $modal.open({
templateUrl: "components/prize-info/prize-info.html",
windowClass: "prize-info",
scope: $scope,
controller: "PrizeInfoController"
});
</code>
<code> $modal.open({
templateUrl: "components/prize-info/prize-info.html",
windowClass: "prize-info",
scope: $scope,
controller: "PrizeInfoController"
});
</code>
$modal.open({
templateUrl: "components/prize-info/prize-info.html",
windowClass: "prize-info",
scope: $scope,
controller: "PrizeInfoController"
});
I have to create two identical modals that differ only in the prizes it’ll show – which are two different arrays in the very same $scope
.
So – instead of duplicating the controller from above and it’s template, changing only the prop of the scope, providing the prizes – how can I pass something to the $modal.open
method and use one and the same controller, which will loop different scope’s prizes?