Modal and Collection-Repeat


#1

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

$scope.myModal.show();

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){ modal.show() });

it shows all items.

Here is a codepen:

It works correctly with ng-repeat


#2

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.


#3

Okay thanks! Will play with that solution :slight_smile: