Pass scope variable into popover scope


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.


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


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

It works perfectly if the variable sort is within an object:

$ = {};
$ = ...

instead of just:

$scope.sort = ....

It seems to be due to javascript protypal inheritance.