jquery-steps icon indicating copy to clipboard operation
jquery-steps copied to clipboard

Dont work with Angular.js

Open jonathanhecl opened this issue 10 years ago • 8 comments

JQuery Steps dont work with Angular.js :( any idea?

i dont want use Angular's controller, i only want to use easy model.

Thanks

jonathanhecl avatar Feb 13 '15 06:02 jonathanhecl

@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 of the child directive is passed through to the parent, without a corresponding 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

wtfiwtz avatar Mar 10 '15 05:03 wtfiwtz

Check the comment in #150 . Maybe it helps.

bambuca avatar Jul 17 '15 13:07 bambuca

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

          }
    }
])

wtfiwtz avatar Jul 18 '15 07:07 wtfiwtz

can yot put the complate sample in plnkr .... thx

amirkheirabadi73 avatar Aug 13 '15 04:08 amirkheirabadi73

Is this fix working?

ernestjohn avatar Jan 29 '16 05:01 ernestjohn

not working with angular2

virtualvoid avatar Feb 25 '16 10:02 virtualvoid

@wtfiwtz Hey man, I need help, Can you put all the complete sample??

adrian1299 avatar Oct 06 '17 02:10 adrian1299

@wtfiwtz Hey, wonder how does it not work for onInit and onContentLoaded event? any advice?

lloydlim avatar Jun 26 '19 08:06 lloydlim