angular-fullpage.js icon indicating copy to clipboard operation
angular-fullpage.js copied to clipboard

Cannot set property 'onLeave' of undefined

Open CYFERIOUS opened this issue 9 years ago • 9 comments

im using angular 1.5 an i get this error when i load the libraries

angular.js:12798 TypeError: Cannot set property 'onLeave' of undefined at sanatizeOptions (angular-fullpage.js:36) at rebuild (angular-fullpage.js:26) at Scope.$digest (angular.js:16218) at Scope.$apply (angular.js:16482) at done (angular.js:10862) at completeRequest (angular.js:11060) at XMLHttpRequest.requestLoaded (angular.js:11001)

CYFERIOUS avatar Jul 08 '16 18:07 CYFERIOUS

I too am having this problem

yellow-cpu avatar Jul 12 '16 20:07 yellow-cpu

@CYFERIOUS I have found a solution to this problem:

Originally I was using bower install --save angular-fullpage.js which would retrieve version 0.2.1

However it seems like the git version is a bit ahead of that version. So my bower.json file now looks like this:

"dependencies": {
    "angular-fullpage.js": "git://github.com/hellsan631/angular-fullpage.js.git#df5ed68de1c8dd0c96a51b40e68801c84fee6bff"
}

After that I still got an error complaining about the options field being undefined. I took a look at the sample code in the repo and found that the div where the directive is specified needed to have an options attribute. I am using components so mine ended up looking like this:

<div full-page options="$ctrl.mainOptions">
    <div class="section">Some section</div>
    <div class="section">Some section</div>
    <div class="section">Some section</div>
</div>

And of course my controller with the variable mainOptions looks like this:

function LandingController() {
      var self = this;

      self.mainOptions = {
        sectionsColor: ['#1bbc9b', '#4BBFC3', '#7BAABE'],
        navigation: true,
        navigationPosition: 'right',
        scrollingSpeed: 1000
      };
}

I hope that this helps you out as well.

yellow-cpu avatar Jul 13 '16 11:07 yellow-cpu

function LandingController() ? i need to set this one under main controller of ng-app?

CYFERIOUS avatar Jul 14 '16 17:07 CYFERIOUS

LandingController() is just the name of my controller I was using. Put the options in the controller associated with whatever template you are using.

yellow-cpu avatar Jul 14 '16 17:07 yellow-cpu

well following your instructions literally, but this error appears now

angular.js:12798 TypeError: Cannot read property 'destroy' of undefined at i (angular-fullpage.min.js:1) at u (angular-fullpage.min.js:1) at Scope.$digest (angular.js:16218) at Scope.$apply (angular.js:16482) at done (angular.js:10862) at completeRequest (angular.js:11060) at XMLHttpRequest.requestLoaded (angular.js:11001)

i really want to implement this, right now im using a demo of br-fullscreen.js but it hasnt enough features to manage it. thanks for your help

CYFERIOUS avatar Jul 14 '16 20:07 CYFERIOUS

@CYFERIOUS did you managed to solve this Cannot read property 'destroy' of undefined error ?

cadupedroni avatar Aug 17 '16 19:08 cadupedroni

@DillonHeins Thanks, installing from out an updated commit fixed the issue.

santiagovdk avatar Dec 07 '16 18:12 santiagovdk

I'm still getting the Cannot read property 'destroy' of undefined error, anyone else resolve it?

@cyferious, @cadupedroni

amscher avatar Feb 06 '17 19:02 amscher

@amscher Show us some code, and what version are you using?

santiagovdk avatar Mar 11 '17 19:03 santiagovdk