abhikmitra / ng-joyride

Angular Joyride Directive for creating custom introductions to websites
126 stars 68 forks source link

Cannot read property 'type' of undefined #7

Closed j8 closed 10 years ago

j8 commented 10 years ago

I have already using bootstrap popover in other part of the system, and initially, when I launch joyride on the first joyride item, I have 'previous' button. So when clicking on it I got:

Cannot read property 'type' of undefined at: if (previousStep.type === "location_change") {

This is the actual function:

function goToPrev() {
                    steps[currentStepCount].cleanUp();

                    var previousStep = steps[currentStepCount - 1];
                    if (previousStep.type === "location_change") {

I'm using Angular UI router also.

abhikmitra commented 10 years ago

So your first step is location change right ?

j8 commented 10 years ago

For some reason yes, I removed any other popovers in the system, and still the first step is location change and it should be disabled 'previous' button

j8 commented 10 years ago

So actually I found that this issue rises, if you want your first item to be element, instead of title.

abhikmitra commented 10 years ago

Yes you are right. Will fix this, in the coming weekend.