Comments (4)
Definitely being able to customize the indicators placement and style via provider would be awesome. If I hack it I'll try to submit a PR.
from angular-wizard.
Its fairly easy to make this happen via a decorator
Add an Attribute to allow for position assignment
angular.module('myApp')
.config(function($provide) {
/**
* Hijacking wizard directive
* need to be able to add methods to the scope
* also want to be able to have more control over our own
* customer template
*/
$provide.decorator('wizardDirective', function($delegate) {
var directive, link;
directive = $delegate[0];
link = directive.link || function(scope) {};
directive.templateUrl = function(element, attrs) {
return attrs.template || "app/components/wizard/wizard.html";
};
directive.compile = function() {
return function(scope, element, attrs, ctrls) {
scope.stepLocation = attrs.stepLocation || "bottom";
return link.apply(this, arguments);
};
};
return $delegate;
});
return $logProvider.debugEnabled(true);
}));
Default to your own template
(default template is overwritten in the above decorator)
<div>
<div ng-if="stepLocation == 'bottom'" class="steps" ng-transclude></div>
<ul class="steps-indicator steps-{{getEnabledSteps().length}}" ng-if="!hideIndicators">
<li ng-class="{default: !step.completed && !step.selected, current: step.selected && !step.completed, done: step.completed && !step.selected, editing: step.selected && step.completed}" ng-repeat="step in getEnabledSteps()">
<a ng-click="goTo(step)">{{step.title || step.wzTitle}}</a>
</li>
</ul>
<div ng-if="stepLocation == 'top'" class="steps" ng-transclude></div>
</div>
Now you can add an attribute to your wizard to specify step indicator
<wizard on-finish="finishedWizard()" step-location="top">
<wz-step title="Starting">
<h1>This is the first step</h1>
<p>Here you can use whatever you want. You can use other directives, binding, etc.</p>
<input type="submit" wz-next value="Continue" />
</wz-step>
<wz-step title="Continuing" canenter="item.validateStep">
<h1>Continuing</h1>
<p>You have continued here!</p>
<input type="submit" wz-next value="Go on" />
</wz-step>
<wz-step title="More steps" canenter="item.validateStep">
<p>Even more steps!!</p>
<input type="submit" wz-next value="Finish now" />
</wz-step>
</wizard>
from angular-wizard.
You can simply use css to put the steps container above the wizard. Way quicker and easier. :)
I have done this more than once now with this wizard and it was flawless. CSS is your friend.
from angular-wizard.
We always suggest writing your own custom CSS but I see the value of actually moving the steps in the DOM to be before the container. If you submit a PR I will happily merge, but I will close this ticket for now.
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.