Comments (4)
ok, @mgonto , maybe you have no time to kill this question.
i make a pull requrest,if it can help you something, i will where happy.
from angular-wizard.
@mgonto or, what i really want is the pre-change event. i can set return false and then break goto event.
from angular-wizard.
Hey @geminiyellow I have an idea for you situation. What if you changed the navigationbar partial to something like this:
//snippet from wizard.html
<a ng-click=\"changeStep(callback, step)\">{{step.title || step.wzTitle}}</a>\n" +
Then in your wizard directive you can add:
$scope.changeStep = function (callback, step) {
if(angular.isFunction(callback){
//if callback returns truthy then run goTo()
if(callback()){
$scope.goTo(step);
}
} else if(!callback){
$scope.goTo(step);
}
};
You can pass your callback function into the template and only if it returns truthy will it fire goTo(). It will also fire goTo() if no callback is present. If you need a unique callback per step you can add it to the step object that is created. So you can call the callback in the template like: step.callback()
Let me know if that doesn't make sense.
from angular-wizard.
@geminiyellow with the most recent update each step now has a canenter
and canexit
attribute where a validation function can be inserted. This validation will have to pass no matter how you get to the step (navigation bar, callingnext()
, calling previous()
, etc...). In regards to the step title, it looks like you have a Pull Request that handles this. I will look at the Pull Request as soon as I can. Thanks for your contributions!
from angular-wizard.
Related Issues (20)
- wizard().goTo() not behaving as expected HOT 3
- setEditMode is not a function HOT 2
- error HOT 1
- ReferenceError on "canexit="exitValidation"" [Fix included] HOT 3
- Angular 4 support? HOT 2
- Can't reference a controller's function from template HOT 2
- Issue when add the canenter feature. HOT 3
- wz-data and canenter are being called multiple times
- removing a step fails if it index 0
- Why from data from first step is lost when a user tries to visit another step?
- on removing wz-step anomaly
- Wizard Handler goTo issue HOT 1
- Can i use this in angular 2 ? HOT 2
- How to make the navigation bar Non clickable? HOT 1
- Disabling steps dynamically
- How to disable navigation in the toolbar HOT 3
- JS Error: _ is not defined
- RTL problem
- back to current step if back to other completed steps
- Input values not sending to PHP
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 angular-wizard.