chore(build): rename ionic directory to src and update all references in the build process.

This commit is contained in:
Josh Thomas
2016-05-19 13:20:59 -05:00
parent 8470ae04ac
commit c8f760f080
595 changed files with 73 additions and 87 deletions

44
src/components/ion.ts Normal file
View File

@ -0,0 +1,44 @@
import {ElementRef} from '@angular/core';
import * as dom from '../util/dom';
let ids: number = 0;
/**
* Base class for all Ionic components. Exposes some common functionality
* that all Ionic components need, such as accessing underlying native elements and
* sending/receiving app-level events.
*/
export class Ion {
private _id: string;
constructor(protected elementRef: ElementRef) {
this._id = 'i' + ids++;
}
getElementRef(): ElementRef {
return this.elementRef;
}
getNativeElement(): any {
return this.elementRef.nativeElement;
}
getDimensions(): {
width: number, height: number, left: number, top: number
} {
return dom.getDimensions(this.elementRef.nativeElement, this._id);
}
width(): number {
return dom.getDimensions(this.elementRef.nativeElement, this._id).width;
}
height(): number {
return dom.getDimensions(this.elementRef.nativeElement, this._id).height;
}
ngOnDestroy() {
dom.clearDimensions(this._id);
}
}