Reputation: 51
I can't get parameter variable(range value) in ionicPopover's range input. Is there any problem in scope? or anything?
[in Controller.js]
.controller('AppCtrl', function(...) {
$scope.selectValue = function(rangeVal) {
console.log(rangeVal); //print 'undefined'
console.log($scope.rangeVal); //print 'undefined'
console.log("hello?"); //print 'hello?'
};
$ionicPopover.fromTemplateUrl('templates/popover.html', {
scope: $scope
}).then(function(popover) {
popover.show(".popover");
});
[in popover.html]
<ion-popover-view>
<ion-content>
<div class="item range">
<input type="range" name="rangeVal" min="0" max="100" ng-model="rangeVal">
</div>
<button ng-click="selectValue({{rangeVal}})">OK</button>
</ion-content>
</ion-popover-view>
in [ion-popover-view] I can watch variable changing
but after click, $scope.selectValue function can't get parameter....
Upvotes: 0
Views: 2916
Reputation: 21789
you dont need the curly bracers to call a function in angular (neither to pass a parameter to that function):
<button ng-click="selectValue(rangeVal)">OK</button>
Upvotes: 2