Giter Site home page Giter Site logo

angular-scroll-watch's People

Contributors

gitter-badger avatar lawnzapper avatar loganarnett avatar pc035860 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

angular-scroll-watch's Issues

sw-stage 'Cannot read property '0' of null'

I use scroll-watch to load more data when scroll to bottom. I have specified sw-stage in index.html like that:
<md-content ng-view md-scroll-y flex sw-stage="indexPageStage" style="background-color: #FAFAFA;"> </md-content>
And i have div with scroll-watch in another file:
`

` When i try to go to another page it divides into two parts (old page on top and new page on bottom) and i got error:
TypeError: Cannot read property '0' of null
    at t.factory.d._isDefault (angular-scroll-watch.min.js:6)
    at t.factory.d._unbind (angular-scroll-watch.min.js:6)
    at t.factory.d.destroy (angular-scroll-watch.min.js:6)
    at t.factory.service._checkStageDestroy (angular-scroll-watch.min.js:6)
    at t.factory.service.removeConfig (angular-scroll-watch.min.js:6)
    at HTMLDivElement.<anonymous> (angular-scroll-watch.min.js:6)
    at Object.eventHandler [as handle] (angular.js:3032)
    at jqLiteRemoveData (angular.js:2591)
    at jqLiteDealoc (angular.js:2542)
    at jqLiteRemove (angular.js:2733)(anonymous function) @ angular.js:11655$get @ angular.js:8596$get.Scope.$digest @ angular.js:14360$get.Scope.$apply @ angular.js:14571(anonymous function) @ angular.js:11411eventHandler @ angular.js:3032

Get element position relative to window

Hello.
I'm trying to get the top position of an element, $offsetTop seems to be relative to the container, is there a way I could get the element position relative to the window, (actual top position in the viewport)?

Thanks

sw-broadcast expression cant use && or ||?

I make a function like "load more end" , but when I first enter , that event("load more end") will trigger,this is my code :

let loadMoreEndDefer;
                let loadMoreEndDeger;
               //here is a real function for the app
                $scope.$on('load more end', ($evt, n, locals) =>{
                    // For the "end" button
                    $log.debug('load more...');

                    return;
                    if(!loadMoreEndDefer){

                        loadMoreEndDefer = userListCtrl.loadMoreEnd(20);
                        loadMoreEndDefer['finally'](()=>{
                            loadMoreEndDefer = null;
                        })

                    }

                });
                //here is a test function for debug
                $scope.$on('test',($evt, n, locals)=>{
                    $log.debug($evt,n,locals);
                });

and my view setting like this :

scroll-watch="{from:0,to:-1,stage:'dialog'}"
sw-broadcast="{'load more end':'$progress ==1 && $positive!=-1','test':true}"

when I first enter,I see the console show this log:

load more...   <- here is the 'load more end' event
{$positive: -1, $negative: -1, $progress: 1, $percentage: 100, $direction: 0…}   <= here is the 'test' event

that mean
'load more end':'$progress ==1 && $positive!=-1' cant work ?
I try use and even & replace && , but will show me error stack

Image floating from left

Hi,

I just stared to use this directive. It seems really good, just I can't figure it out, how can I float one of my images.
Basically, when the user is scrolling, the image starts the float from out of the screen on the left side, and finally arrives the original point.
I tried with this:

scroll-watch="{from: 1000, to: -1}" sw-style="{left: 100 * $progress + '%'}"

but the direction is wrong, and now is going to right from the starting point.
Do you know where is the problem?

Using Scroll-Watch with ng-if

Hi,
I have a big list of items to show on page in a table.
I would like to watch the scroll value of the element so I'd know which items to show/hide using ng-if.
How can evaluate the scrollable value of the table?
My code is:

<tr ng-repeat="item in displayList track by $index"
                    scroll-watch="{from: 0, to: -1}"
                    ng-if="........">

Thanks.

Two way binding

@pc035860 is it possible to change for example the $progress variable externaly to scroll for example to a curtain point automatically?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.