trazek / ionic-modal-nav-example Goto Github PK
View Code? Open in Web Editor NEWA starting project showing how the ionic-modal-nav can be used in Ionic applications
Home Page: https://www.npmjs.com/package/ionic-modal-nav
A starting project showing how the ionic-modal-nav can be used in Ionic applications
Home Page: https://www.npmjs.com/package/ionic-modal-nav
How can I access the data that is passed in goBack() method, when I go back to the previous model view ?
Whenever
$ionicHistory.clearCache
is called within the modal, if I swipe to go back (instead of calling $IonicModalNavService.goBack) the modal just becomes white and the app has to be restarted.
I want to IonicModalService library on my sidemenu app, but displayed darkscreen(or whitescreen) when modal closd by IonicModalService and move to previous page. ($ionicModal is works fine)
here my sample code:
https://drive.google.com/file/d/0Bzs8N33JOtOWWk9oazVjbjd2LU0/view?usp=sharing
Thanks.
Can't seem to get IonicModalNav to work properly. Code is below:
angular.module('blah.controllers', ['ionic','blah.services','ngCordova','blah.utils', 'IonicModalNav'])
.controller('MainCtrl', ['$scope', '$location','$stateParams', '$ionicModal', 'IonicModalNavService') {
$scope.openPreferenceSelector = function(type) {
IonicModalNavService.go('blahselector');
}
Any idea why? "ionic-modal-nav": "^1.0.4" is included in my package.json and it's installed.
I'm using ionic 1.3.1 if that makes a difference.
Hello,
I could not find the repository for the ionic-modal-nav
component?
I would like to use this component in my project but with bower, but since you did not publish it on bower I could always add it from git if I could find your repository?
It would also be easier to propose enhancements via PR if it had its own separate repository.
I'm passing the data using:
IonicModalNavService.go('blah', { id: blah });
When the control for that modal initializes this line will run:
console.log($stateParams.id);
This returns an empty string, rather than undefined. What's being passed into id is a valid integer, rather than an empty string. Any idea what I'm doing wrong here?
Hi there, first thank you for your plugin, it's pretty awesome.
I'm having an issue when I navigate through modal view and populating array. The two modal states are sharing the same controller. In one hand, I'm populating a scope variable array from modal A and in another hand, display this array inside the modal B.
But the array on modal B stays empty.
Questions :
EDIT : Just realised that the controller (and also the initialization of my variable) is called on $state.go due. Preferable to split controller and share the data with a directive.
Thank you
Hi and sorry to my english.
I want to pass data to modal with $stateParams, but IonicModalNavService does not passed.
Here is my code:
// 1. register a route to $stateProvider
$stateProvider.state('comment-list', {
views: {
'ionic-modal-nav@': {
templateUrl: 'views/board/article-comment.html',
controller: 'MyController as myCtrl'
}
},
param: {
url: null,
articleID: null
}
});
// 2. show and pass data by IonicModalNavService
IonicModalNavService.show('comment-list', {
url: vm.store.url,
articleID: vm.article.id,
});
// 3. check passed data at MyController, but it is empty.
function MyController($scope, $stateParams) {
console.log($stateParams.url); // undefined
console.log($stateParams.articleID); // undefined
...
}
so i change few code:
key: "show",
value: function show(modalState, data) {
...
// fire event with passed data
this._$rootScope.$emit(SHOW_MODAL, data);
...
function IonicModalNavService($ionicModal, $rootScope, $state, $ionicHistory, $ionicViewSwitcher, modalOptions) {
...
$rootScope.$on(SHOW_MODAL, function (event, data) {
// set passed data to modal object
_this._modal.params = data;
_this._modal.show();
});
...
}
so i got passed data at MyController:
function MyController($scope, $stateParams) {
$scope.$on('modal.shown', function (e, data) {
console.log(data.params.url); // http://abc.com
console.log(data.params.articleID); // 100
});
...
}
Please check this issue. Thanks.
The default ionic modal opens with:
$ionicModal.fromTemplateUrl("templates/modal.html", {
scope: $scope,
backdropClickToClose: false, // Default true
animation: 'slide-in-up'
})
.then(function(modal){
$scope.modal = modal;
$scope.modal.show();
})
backdropClickToClose can be passed in to allow/disallow closing the modal by clicking the backdrop. Is this currently possible? I gave the following a shot:
IonicModalNavService.show('app.initiallaunch_personalinfo', {backdropClickToClose: true});
It didn't work, as I guessed, since that object is meant to be data, rather than options. I think this would be helpful to pass in on initial instantiation.
Is this compatible with Angular 1?
@trazek ... thanks!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.