Modal and Collection-Repeat

I want to put a modal on a variable, that it needn’t created every time i want to show it (performance?). for example in Controller:

$ionicModal.fromTemplateUrl('template.html',{...}).then(function(modal){ $scope.myModal = modal; });

and then in the controller


But in the Collection-Repeat in the modal, only the last item is shown (edit: on a special height of the site, only the first item is shown). Only if i resize the site, the other items get shown… Tried some $apply()'s, but doesnt work.

If i show the modal directly:

$ionicModal.fromTemplateUrl('template.html',{...}).then(function(modal){ });

it shows all items.

Here is a codepen:

It works correctly with ng-repeat

Take a look at this codepen. What you can do is hide the list until the modal is shown and then with an ng-if, show it.

1 Like

Okay thanks! Will play with that solution :slight_smile: