Created
July 13, 2015 11:16
-
-
Save cobbspur/bc44704b79b39a78d876 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// setup.hbs | |
{{#if stepOne}} | |
<ol> | |
<li class="active"><span class="step"><i class="icon-check"></i><span class="num">1</span></span></li> | |
<li><a class="step" {{action "toStepTwo"}}><i class="icon-check"></i><span class="num">2</span></a></li> | |
<li><span class="step"> <i class="icon-check"></i><span class="num">3</span></span></li> | |
</ol> | |
{{/if} | |
// {{#if stepTwo}}... | |
{{#if stepOne}} | |
{{gh-setup-step-one nextStep="toStepTwo"}} | |
{{/if}} | |
// controller - setup.js | |
export default Ember.Controller.extend(ValidationEngine, { | |
stepOne: true, | |
stepTwo: false, | |
stepThree: false, | |
actions: { | |
toStepOne: function() { | |
this.setProperties({ | |
stepOne: true, | |
stepTwo: false, | |
stepThree: false | |
}); | |
}, | |
toStepTwo: function() { | |
this.setProperties({ | |
stepOne: false, | |
stepTwo: true, | |
stepThree: false | |
}); | |
}, | |
toStepThree: function() { | |
this.setProperties({ | |
stepOne: false, | |
stepTwo: false, | |
stepThree: true | |
}); | |
}, | |
} | |
}); | |
// component/template - gh-setup-step-one.hbs | |
<a class="btn btn-green btn-lg" {{action "nextStep"}}>Create your account <i class="icon-chevron"></i> </a> | |
// component/js gh-setup-step-one.js | |
import Ember from 'ember'; | |
import {ValidationMixin, validate} from 'ember-cli-simple-validation/mixins/validate'; | |
export default Ember.Component.extend(ValidationMixin, { | |
nextStep: undefined, | |
actions: { | |
nextStep: function () { | |
this.sendAction('toStepTwo'); | |
} | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment