1

First of all, I'm using jQuery-Smart-Wizard.

When I put it into my code:

$('#wizard_verticle').smartWizard({
    transitionEffect: 'slide'
});

this is supposed to change the DOM, but it's wrapped inside angular controller and it doesn't seems to work for some reason.

Here's a jsfiddle to reproduce this.

Errors:

developer033
  • 24,267
  • 8
  • 82
  • 108
Justin Homes
  • 3,739
  • 9
  • 49
  • 78
  • 1
    Needs to be initialized in a directive. DOM code doesn't belong in controllers. Doing it in directive assures that element exists when code is run – charlietfl Jul 06 '16 at 02:52
  • this is my first attempt at using angular in my project can you direct me to an example of what you are saying ? @charlietfl – Justin Homes Jul 06 '16 at 02:54
  • 1
    Ultra simple demo http://plnkr.co/edit/gVQbDo4dPWAYOdaqecJR?p=preview – charlietfl Jul 06 '16 at 03:01
  • @charlietfl i think this worked great but can you bind to controller function from directive? example there is a onFinish: event you can wire when you $('#wizard').smartWizard({ onFinish: gotoSubmit() }) how can this be done? – Justin Homes Jul 06 '16 at 15:39
  • see `scope` argument of `link` in demo. Find some tutorials on directives. They are important part of using angular. Also read up on scope inheritance – charlietfl Jul 06 '16 at 15:52

0 Answers0