jquery-steps
jquery-steps copied to clipboard
Dont work with Angular.js
JQuery Steps dont work with Angular.js :( any idea?
i dont want use Angular's controller, i only want to use easy model.
Thanks
@gshaxor, you can use this approach:
http://stackoverflow.com/questions/25129845/jquery-steps-into-a-angularjs-directive#answer-25182764
However, you will quickly come up against another problem, if you use transclude: true on any child directives (... a problem I am still trying to solve, as I want to use this: https://github.com/angular-ui/angular-google-maps).
The error I am getting is "Illegal use of ngTransclude directive in the template", since the transclude: true.
I'm still trying to solve this one.
Another option is to switch to a dedicated Angular.js Wizard - https://github.com/mgonto/angular-wizard
Check the comment in #150 . Maybe it helps.
Here was my final solution, including event handlers:
app.directive('uiWizardForm', [ ->
return {
scope: {
stepChanging: '=',
stepChanged: '=',
finished: '&'
},
compile: (tElement, tAttrs, transclude) ->
tElement.wrapInner('<div class="steps-wrapper">')
steps = tElement.children('.steps-wrapper').steps({
})
return {
pre: (scope, ele, attrs) ->
post: (scope, ele, attrs) ->
# Post-link function
ele.closest('form').validate();
ele.children('.steps-wrapper').on 'stepChanged', ->
scope.$apply ->
scope.stepChanged(ele.children('.steps-wrapper')) if tAttrs.stepChanged?
ele.children('.steps-wrapper').on 'finished', ->
scope.$apply ->
scope.finished() if tAttrs.finished?
ele.children('.steps-wrapper').on 'stepChanging', ->
scope.$apply ->
return scope.stepChanging(ele.children('.steps-wrapper')) if tAttrs.stepChanging?
true
}
}
])
can yot put the complate sample in plnkr .... thx
Is this fix working?
not working with angular2
@wtfiwtz Hey man, I need help, Can you put all the complete sample??
@wtfiwtz Hey, wonder how does it not work for onInit and onContentLoaded event? any advice?