benmarch / angular-bootstrap-tour

AngularJS wrapper around Bootstrap Tour
64 stars 27 forks source link

onStart and onEnd not working? #29

Open HeadwayLabs opened 8 years ago

HeadwayLabs commented 8 years ago

I am trying to call a function in my controller on an element with a tour using:

on-end="end(tour)"
$scope.end = function (tour) {
        localStorage.set('tour-ended');
};

But I cant get it to work. I can use onShow, OnNext, OnHide etc, but not onEnd and start for some reason.

Any help would be appreciated.

Thanks

benmarch commented 8 years ago

I believe this is due to Angular's multi-element directives feature that looks for attribute and element names ending with "start" and "end". Try changing it to on-end-end="end(tour)".

HeadwayLabs commented 8 years ago

I tried this but no luck. I am expecting it to fire when I click the end tour button on any step. Is this correct?

benmarch commented 8 years ago

I tested this locally and it should just be on-end="end(tour)", sorry for the confusion (for onStart you have to use on-start-start). It looks like it is working as expected, the function I created does fire when I click the "End Tour" button. Can you paste some markup and controller code here so I can take a look? My best guess is that your end function is not in scope.

benmarch commented 8 years ago

Any update on this?

benmarch commented 8 years ago

Any update, @HeadwayLabs?