hellsan631 / angular-fullpage.js

An angular directive for fullpage.js

Home Page:http://hellsan631.github.io/angular-fullpage.js/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot set property 'onLeave' of undefined

CYFERIOUS opened this issue · 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)

I too am having this problem

@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.

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

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

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 did you managed to solve this Cannot read property 'destroy' of undefined error ?

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

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

@CYFERIOUS, @cadupedroni

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