Hill30 / NGScroller

Bidirectional infinite scrolling with dynamic data load
MIT License
69 stars 20 forks source link

viewport.css() undefined error #53

Closed uberspeck closed 10 years ago

uberspeck commented 10 years ago

I have the ui-scroll-viewport defined, but i'm seeing the following in the console...

Error: 'undefined' is not a function (evaluating 'viewport.css({
    'overflow-y': 'auto',
    'display': 'block'
})')
reifi commented 10 years ago

That's because the directive's controller returns the element. A controller/constructor usually never returns anything, so they changed it in 1.3.x. in the controller, instead of returning the viewport element do:

this.viewport = element;

in the uiScroll directive where the viewport is defined:

viewport = controllers[0].viewport || angular.element(window)
mfeingold commented 10 years ago

can you post a repro?

reifi commented 10 years ago

no need to repro: "Return" in directive's controllers no longer works in 1.3.0-rc.0 https://github.com/angular/angular.js/issues/8876

uberspeck commented 10 years ago

thanks @reifi , that fixed my issue

mfeingold commented 10 years ago

@dhilt, please provide a fix for the issue

mfeingold commented 10 years ago

@dhilt I was too fast closing the issue. Something's broken with the travis. Can you have a look?

dhilt commented 10 years ago

it was travis npm version incompatibility error, fixed by https://github.com/Hill30/NGScroller/pull/56 (.travis.yml update)