lakshman_dev lakshman_dev - 1 year ago 321
AngularJS Question

How can params be passed through Ionic Modal?

Like we pass params through modal, as did in below by

example :

$scope.someFunction = function(item) {
item.root = true;
modalInstance = ${
animation: true,
controller: 'newController',
templateUrl: '/views/modals/somePage.html',
resolve: {
params: function () {
return { item: item};

I am not sure how to pass params in ionicModal ??

$ionicModal.fromTemplateUrl('main/templates/viewPage.html', {
scope: $scope,
animation: 'slide-in-up'
}).then(function(modal) {
$scope.modal = modal;

Is there an option along with
as in above ionicModal code?

Help is much appreciated!

Answer Source

You do not need to pass any data. Your parent scope is already passed as

scope : $scope

So you can take your data as scope.item.

Please follow this URL

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download