ng2-uploader
Version:
Angular2 File Uploader
94 lines (93 loc) • 4.03 kB
text/typescript
/**
* @fileoverview This file is generated by the Angular 2 template compiler.
* Do not edit.
* @suppress {suspiciousCode,uselessCode,missingProperties}
*/
/* tslint:disable */
import * as import0 from '../../../src/directives/ng-file-drop';
import * as import1 from '@angular/core/src/change_detection/change_detection_util';
import * as import2 from '@angular/core/src/linker/view';
import * as import3 from '@angular/core/src/linker/view_utils';
export class Wrapper_NgFileDropDirective {
/*private*/ _eventHandler:Function;
context:import0.NgFileDropDirective;
/*private*/ _changed:boolean;
/*private*/ _changes:{[key: string]:any};
/*private*/ _expr_0:any;
/*private*/ _expr_1:any;
subscription0:any;
subscription1:any;
subscription2:any;
subscription3:any;
subscription4:any;
constructor(p0:any,p1:any) {
this._changed = false;
this._changes = {};
this.context = new import0.NgFileDropDirective(p0,p1);
this._expr_0 = import1.UNINITIALIZED;
this._expr_1 = import1.UNINITIALIZED;
}
ngOnDetach(view:import2.AppView<any>,componentView:import2.AppView<any>,el:any):void {
}
ngOnDestroy():void {
(this.subscription0 && this.subscription0.unsubscribe());
(this.subscription1 && this.subscription1.unsubscribe());
(this.subscription2 && this.subscription2.unsubscribe());
(this.subscription3 && this.subscription3.unsubscribe());
(this.subscription4 && this.subscription4.unsubscribe());
}
check_options(currValue:any,throwOnChange:boolean,forceUpdate:boolean):void {
if ((forceUpdate || import3.checkBinding(throwOnChange,this._expr_0,currValue))) {
this._changed = true;
this.context.options = currValue;
this._changes['options'] = new import1.SimpleChange(this._expr_0,currValue);
this._expr_0 = currValue;
}
}
check_events(currValue:any,throwOnChange:boolean,forceUpdate:boolean):void {
if ((forceUpdate || import3.checkBinding(throwOnChange,this._expr_1,currValue))) {
this._changed = true;
this.context.events = currValue;
this._changes['events'] = new import1.SimpleChange(this._expr_1,currValue);
this._expr_1 = currValue;
}
}
ngDoCheck(view:import2.AppView<any>,el:any,throwOnChange:boolean):boolean {
var changed:any = this._changed;
this._changed = false;
if (!throwOnChange) {
if (changed) {
this.context.ngOnChanges(this._changes);
this._changes = {};
}
if ((view.numberOfChecks === 0)) { this.context.ngOnInit(); }
}
return changed;
}
checkHost(view:import2.AppView<any>,componentView:import2.AppView<any>,el:any,throwOnChange:boolean):void {
}
handleEvent(eventName:string,$event:any):boolean {
var result:boolean = true;
if ((eventName == 'change')) {
const pd_sub_0:any = ((<any>this.context.onChange()) !== false);
result = (pd_sub_0 && result);
}
if ((eventName == 'dragover')) {
const pd_sub_1:any = ((<any>this.context.onDragOver($event)) !== false);
result = (pd_sub_1 && result);
}
if ((eventName == 'dragleave')) {
const pd_sub_2:any = ((<any>this.context.onDragLeave($event)) !== false);
result = (pd_sub_2 && result);
}
return result;
}
subscribe(view:import2.AppView<any>,_eventHandler:any,emit0:boolean,emit1:boolean,emit2:boolean,emit3:boolean,emit4:boolean):void {
this._eventHandler = _eventHandler;
if (emit0) { (this.subscription0 = this.context.onUpload.subscribe(_eventHandler.bind(view,'onUpload'))); }
if (emit1) { (this.subscription1 = this.context.onPreviewData.subscribe(_eventHandler.bind(view,'onPreviewData'))); }
if (emit2) { (this.subscription2 = this.context.onFileOver.subscribe(_eventHandler.bind(view,'onFileOver'))); }
if (emit3) { (this.subscription3 = this.context.onUploadRejected.subscribe(_eventHandler.bind(view,'onUploadRejected'))); }
if (emit4) { (this.subscription4 = this.context.beforeUpload.subscribe(_eventHandler.bind(view,'beforeUpload'))); }
}
}