Created
November 9, 2015 17:43
-
-
Save loujaybee/2e72b6f666fef94c9264 to your computer and use it in GitHub Desktop.
Angular watch and unwatch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Wait for the value to be populated, initialise and then close | |
var setupWatch = scope.$watch('collectionToPopulate', function(){ | |
if(!_.isEmpty(scope.collectionToPopulate)){ | |
infinite_scroll.loadInitialElements(); | |
infinite_scroll.setupInfiniteScrollToRunOnDelay(); | |
setupWatch(); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment