mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
feat(Ion): Base component class
This commit is contained in:
@@ -2,6 +2,8 @@ import {ElementRef} from 'angular2/angular2'
|
||||
import {Component} from 'angular2/src/core/annotations_impl/annotations';
|
||||
import {View} from 'angular2/src/core/annotations_impl/view';
|
||||
|
||||
import {Ion} from '../ion';
|
||||
|
||||
|
||||
@Component({
|
||||
selector: 'ion-content'
|
||||
@@ -9,15 +11,12 @@ import {View} from 'angular2/src/core/annotations_impl/view';
|
||||
@View({
|
||||
template: `<div class="scroll-content"><content></content></div>`
|
||||
})
|
||||
export class Content {
|
||||
export class Content extends Ion{
|
||||
constructor(elementRef: ElementRef) {
|
||||
// TODO(maxlynch): we need this nativeElement for things like aside, etc.
|
||||
// but we should be able to stamp out this behavior with a base IonicComponent
|
||||
// or something, so all elements have a nativeElement reference or a getElement() method
|
||||
this.ele = elementRef.nativeElement;
|
||||
super(elementRef);
|
||||
|
||||
setTimeout(() => {
|
||||
this.scrollElement = this.ele.children[0];
|
||||
this.scrollElement = elementRef.nativeElement.children[0];
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user