scroll docs wip

This commit is contained in:
Tim Lancina
2015-08-31 09:29:39 -05:00
parent f81a20f97d
commit a288b9bc0b
2 changed files with 78 additions and 3 deletions

View File

@@ -23,14 +23,25 @@ import {IonicComponent} from '../../config/annotations';
template: '<scroll-content><ng-content></ng-content></scroll-content>'
})
export class Scroll extends Ion {
constructor(elementRef: ElementRef, ionicConfig: IonicConfig) {
super(elementRef, ionicConfig);
/**
* TODO
* @param {ElementRef} elementRef TODO
* @param {IonicConfig} config TODO
*/
constructor(elementRef: ElementRef, config: IonicConfig) {
super(elementRef, config);
setTimeout(() => {
this.scrollElement = this.getNativeElement().children[0];
});
}
/**
* Add a scroll event handler to the scroll element if it exists.
* @param {Function} handler The scroll handler to add to the scroll element.
* @returns {?Function} a function to remove the specified handler, otherwise
* undefined if the scroll element doesn't exist.
*/
addScrollEventListener(handler) {
if(!this.scrollElement) { return; }