Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70612

Pass scope variable into popover scope

$
0
0

@LouisR wrote:

Hi

I would like to pass a variable from the view scope ($scope.sort) into the popover scope.
Once set in the popover, the variable 'goes out' of it with no issue though, with code below in
$scope.closeSortPopover`.

I thought the popover scope was the same as the scope of the controller it comes from.
But it seems it's not the case.
Where is the popover scope ?
If I understand correctly from here the popover scope is a child of the controller scope. So how can I access it... ?

FYI my popover is a list of <ion-radio>s offering different sorting opions for the big list in my main view.

html:

<button ng-click="openSortPopover($event, sort)">

controllers.js

$ionicPopover.fromTemplateUrl('templates/computeSortPopover.html', {
   scope: $scope
}).then(function(popover) {
   $scope.sortPopover = popover;
});
$scope.openSortPopover = function($event, sort) {
   $scope.sortPopover.show($event);
};
$scope.closeSortPopover = function(sort) {
   $scope.sortPopover.hide();
   $scope.sort = sort;
};

Posts: 2

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 70612

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>