pc035860 / angular-scroll-watch Goto Github PK
View Code? Open in Web Editor NEWScroll-aware AngularJS with ease.
Home Page: http://goo.gl/berxqU
License: MIT License
Scroll-aware AngularJS with ease.
Home Page: http://goo.gl/berxqU
License: MIT License
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:
`
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
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
Thanks to angular/angular.js@2f4437b, I had to add $rootScope.$digest();
on line 347 to get things working.
Scroll left
Hello,
Will this, at some point, be available on the NPM registry?
Thanks!
Jerome
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
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?
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.
my code is
But i want animationto be happend only once
@pc035860 is it possible to change for example the $progress
variable externaly to scroll for example to a curtain point automatically?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.