Comments (11)
I will try to look into that as soon as I find time. It's been busy lately!
from ionic-wizard.
Could you pin point where I could start looking? .. would be happy to contribute.
from ionic-wizard.
I fixed the issue. Could you please download the ion-wizard.js from here and replace it in your project?
It should work with ng-if now. Let me know if it works for you. Then I will build a new release.
from ionic-wizard.
I will try this and let you know. Thnx @arielfaur 👍
from ionic-wizard.
Hey, this didn't fix the issue.
However, I was able to reproduce the issue in this Plunker
if you check intro.html
slide 2 has been marked as ng-if="false"
this doesn't render the slide 2 which is correct but it messes up the next-condition check for slide 3.
remove ng-if="false" on slide 2 to see the validation working on screen 3.
Hope this helps.
from ionic-wizard.
You are right. I have tried your use case and it still doesn't work. I'll look into it, thanks!
from ionic-wizard.
Ok. thanks 👍
from ionic-wizard.
Hi
Is there any chance that this enhancement was created? I am looking for a way to conditionally display specific slides via the wizard. Thanks!
from ionic-wizard.
Is there a workaround for this in the meantime? I just need to skip a step given a specific condition.
from ionic-wizard.
@johnhearn I don't have time to maintain these modules for Ionic 1, I am focused on Ionic 2 now. The feature you request is not implemented. You would have to modify the plugin. It should be easy though!
from ionic-wizard.
@johnhearn, this is how I managed to get it work. Check for the sample code below.
parent container for slides
<ion-view hide-nav-bar="true">
<ion-slide-box show-pager="false" ion-wizard on-slide-changed="changePage($index)">
<ion-slide ion-wizard-step ng-repeat="step in page.steps | filter:{skip:'!true'} track by step.view" ui-view="{{step.view}}">
</ion-slide>
</ion-slide-box>
</ion-view>
controller code
$scope.page = {};
$scope.page.steps = [
{view:"step_one"},
{view:"step_two"},
{view:"step_three"},
{view:"step_four"},
{view:"step_five"}
];
var all_steps_by_name = $scope.page.steps.map(function(e){
return e.view;
});
function getStepIndex(viewname){
return all_steps_by_name.indexOf(viewname);
}
$scope.changePage = function(i){
$scope.page.curr_index = i;
}
$scope.changePage(0); //init
// performance - render only current slide
$scope.showSlide =function(i){
return (Math.abs(i - $scope.page.curr_index) < 1);
}
// got to next slide
$scope.page.next = function(){
$ionicSlideBoxDelegate.next();
return true;
}
// update slidebox
$scope.page.updateSteps = function(){
$ionicSlideBoxDelegate.update();
}
// critical to update slidebox after changing properties of steps
$scope.$watch('page.steps',function(){
$scope.page.updateSteps();
$timeout(function(){
$scope.page.updateSteps();
}, 500);
},true);
//conditionally render steps
$scope.page.steps[getStepIndex("step_two")].skip = true;
$scope.page.steps[getStepIndex("step_four")].skip = Math.random() >= 0.5;
sample and general html for steps (step_one.html)
<ion-wizard-content>
<div ng-if="showSlide($index)">
<div>
<p>content</p>
</div>
<div class="padding">
<button class="button button-block" ng-click="page.next()">
Next
</button>
</div>
</div>
</ion-wizard-content>
states structure
.state('container', {
url: '/xyz',
abstract: true,
views: {
'menuContent': {
templateUrl: 'templates/container.html',
controller: 'ContainerCtrl'
}
}
})
.state('container.steps',{
url: '',
views: {
'step_one':{
templateUrl: 'templates/step_one.html'
},
'step_two':{
templateUrl: 'templates/step_two.html',
controller: 'StepTwoCtrl'
}
// likewise ...
}
})
Hope this helps.
from ionic-wizard.
Related Issues (19)
- Start condition HOT 2
- Skip or Forward to a Step according a condition HOT 1
- Unable to use ng-repeat for ion-slide HOT 5
- Strange UI issue on Tab HOT 2
- Support for Ionic 1.2 and + HOT 2
- long content doesn't scroll HOT 6
- Is next-condition checked for the first slide? HOT 5
- In the middle between page 1 and page 2
- Cannot read property 'slideNext' of undefined HOT 2
- About my concept HOT 3
- submit form every step HOT 3
- next-condition not working in first step HOT 2
- not loading inside Facebook page HOT 1
- support for ionic 3/4
- condition does not work with ng-repeat HOT 1
- When condition of next step is false, ion-wizard-next elements should be (optionally) disabled HOT 8
- scope.$on('slideBox.slideChanged') doesn't triggers, so buttons are not getting updated with the ng-hide toggle HOT 5
- Help needed to restart the wizard from 1st slide HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ionic-wizard.