/**
 * This file is generated by the Angular 2 template compiler.
 * Do not edit.
 */
 /* tslint:disable */

import * as import0 from '@angular/core/src/render/api';
import * as import1 from '@angular/core/src/linker/view';
import * as import2 from '@angular/core/src/linker/element';
import * as import3 from './checkbox';
import * as import4 from '@angular/core/src/linker/view_utils';
import * as import5 from '@angular/core/src/di/injector';
import * as import6 from '@angular/core/src/linker/view_type';
import * as import7 from '@angular/core/src/change_detection/change_detection';
import * as import8 from '../../config/config';
import * as import9 from '../../util/form';
import * as import10 from '../item/item';
import * as import11 from '@angular/core/src/linker/element_ref';
import * as import12 from '@angular/forms/src/directives/control_value_accessor';
import * as import13 from '@angular/core/src/metadata/view';
import * as import14 from '@angular/core/src/linker/component_factory';
import * as import15 from '../button/button';
import * as import16 from '../button/button.ngfactory';
var renderType_Checkbox_Host:import0.RenderComponentType = (null as any);
class _View_Checkbox_Host0 extends import1.AppView<any> {
  _el_0:any;
  /*private*/ _appEl_0:import2.AppElement;
  _Checkbox_0_4:import3.Checkbox;
  __NG_VALUE_ACCESSOR_0_5:any[];
  /*private*/ _expr_1:any;
  constructor(viewUtils:import4.ViewUtils,parentInjector:import5.Injector,declarationEl:import2.AppElement) {
    super(_View_Checkbox_Host0,renderType_Checkbox_Host,import6.ViewType.HOST,viewUtils,parentInjector,declarationEl,import7.ChangeDetectorStatus.CheckAlways);
  }
  get _NG_VALUE_ACCESSOR_0_5():any[] {
    if ((this.__NG_VALUE_ACCESSOR_0_5 == (null as any))) { (this.__NG_VALUE_ACCESSOR_0_5 = [this._Checkbox_0_4]); }
    return this.__NG_VALUE_ACCESSOR_0_5;
  }
  createInternal(rootSelector:string):import2.AppElement {
    this._el_0 = this.selectOrCreateHostElement('ion-checkbox',rootSelector,(null as any));
    this._appEl_0 = new import2.AppElement(0,(null as any),this,this._el_0);
    var compView_0:any = viewFactory_Checkbox0(this.viewUtils,this.injector(0),this._appEl_0);
    this._Checkbox_0_4 = new import3.Checkbox(this.parentInjector.get(import8.Config),this.parentInjector.get(import9.Form),this.parentInjector.get(import10.Item,(null as any)),new import11.ElementRef(this._el_0),this.renderer);
    this._appEl_0.initComponent(this._Checkbox_0_4,[],compView_0);
    compView_0.create(this._Checkbox_0_4,this.projectableNodes,(null as any));
    var disposable_0:Function = this.renderer.listen(this._el_0,'click',this.eventHandler(this._handle_click_0_0.bind(this)));
    this._expr_1 = import7.UNINITIALIZED;
    this.init([].concat([this._el_0]),[this._el_0],[disposable_0],[]);
    return this._appEl_0;
  }
  injectorGetInternal(token:any,requestNodeIndex:number,notFoundResult:any):any {
    if (((token === import3.Checkbox) && (0 === requestNodeIndex))) { return this._Checkbox_0_4; }
    if (((token === import12.NG_VALUE_ACCESSOR) && (0 === requestNodeIndex))) { return this._NG_VALUE_ACCESSOR_0_5; }
    return notFoundResult;
  }
  detectChangesInternal(throwOnChange:boolean):void {
    this.detectContentChildrenChanges(throwOnChange);
    if (!throwOnChange) { if ((this.numberOfChecks === 0)) { this._Checkbox_0_4.ngAfterContentInit(); } }
    const currVal_1:any = this._Checkbox_0_4._disabled;
    if (import4.checkBinding(throwOnChange,this._expr_1,currVal_1)) {
      this.renderer.setElementClass(this._el_0,'checkbox-disabled',currVal_1);
      this._expr_1 = currVal_1;
    }
    this.detectViewChildrenChanges(throwOnChange);
  }
  destroyInternal():void {
    this._Checkbox_0_4.ngOnDestroy();
  }
  private _handle_click_0_0($event:any):boolean {
    this._appEl_0.componentView.markPathToRootAsCheckOnce();
    const pd_0:any = ((<any>this._Checkbox_0_4._click($event)) !== false);
    return (true && pd_0);
  }
}
function viewFactory_Checkbox_Host0(viewUtils:import4.ViewUtils,parentInjector:import5.Injector,declarationEl:import2.AppElement):import1.AppView<any> {
  if ((renderType_Checkbox_Host === (null as any))) { (renderType_Checkbox_Host = viewUtils.createRenderComponentType('',0,import13.ViewEncapsulation.None,[],{})); }
  return new _View_Checkbox_Host0(viewUtils,parentInjector,declarationEl);
}
export const CheckboxNgFactory:import14.ComponentFactory<import3.Checkbox> = new import14.ComponentFactory<import3.Checkbox>('ion-checkbox',viewFactory_Checkbox_Host0,import3.Checkbox);
const styles_Checkbox:any[] = [];
var renderType_Checkbox:import0.RenderComponentType = (null as any);
class _View_Checkbox0 extends import1.AppView<import3.Checkbox> {
  _el_0:any;
  _el_1:any;
  _el_2:any;
  /*private*/ _appEl_2:import2.AppElement;
  _Button_2_4:import15.Button;
  _text_3:any;
  /*private*/ _expr_0:any;
  /*private*/ _expr_1:any;
  /*private*/ _expr_2:any;
  /*private*/ _expr_3:any;
  /*private*/ _expr_4:any;
  constructor(viewUtils:import4.ViewUtils,parentInjector:import5.Injector,declarationEl:import2.AppElement) {
    super(_View_Checkbox0,renderType_Checkbox,import6.ViewType.COMPONENT,viewUtils,parentInjector,declarationEl,import7.ChangeDetectorStatus.CheckAlways);
  }
  createInternal(rootSelector:string):import2.AppElement {
    const parentRenderNode:any = this.renderer.createViewRoot(this.declarationAppElement.nativeElement);
    this._el_0 = this.renderer.createElement(parentRenderNode,'div',(null as any));
    this.renderer.setElementAttribute(this._el_0,'class','checkbox-icon');
    this._el_1 = this.renderer.createElement(this._el_0,'div',(null as any));
    this.renderer.setElementAttribute(this._el_1,'class','checkbox-inner');
    this._el_2 = this.renderer.createElement(parentRenderNode,'button',(null as any));
    this.renderer.setElementAttribute(this._el_2,'class','item-cover');
    this.renderer.setElementAttribute(this._el_2,'ion-button','item-cover');
    this.renderer.setElementAttribute(this._el_2,'role','checkbox');
    this.renderer.setElementAttribute(this._el_2,'type','button');
    this._appEl_2 = new import2.AppElement(2,(null as any),this,this._el_2);
    var compView_2:any = import16.viewFactory_Button0(this.viewUtils,this.injector(2),this._appEl_2);
    this._Button_2_4 = new import15.Button((null as any),'item-cover',this.parentInjector.get(import8.Config),new import11.ElementRef(this._el_2),this.renderer);
    this._appEl_2.initComponent(this._Button_2_4,[],compView_2);
    this._text_3 = this.renderer.createText((null as any),' ',(null as any));
    compView_2.create(this._Button_2_4,[[].concat([this._text_3])],(null as any));
    this._expr_0 = import7.UNINITIALIZED;
    this._expr_1 = import7.UNINITIALIZED;
    this._expr_2 = import7.UNINITIALIZED;
    this._expr_3 = import7.UNINITIALIZED;
    this._expr_4 = import7.UNINITIALIZED;
    this.init([],[
      this._el_0,
      this._el_1,
      this._el_2,
      this._text_3
    ]
    ,[],[]);
    return (null as any);
  }
  injectorGetInternal(token:any,requestNodeIndex:number,notFoundResult:any):any {
    if (((token === import15.Button) && ((2 <= requestNodeIndex) && (requestNodeIndex <= 3)))) { return this._Button_2_4; }
    return notFoundResult;
  }
  detectChangesInternal(throwOnChange:boolean):void {
    this.detectContentChildrenChanges(throwOnChange);
    if (!throwOnChange) { if ((this.numberOfChecks === 0)) { this._Button_2_4.ngAfterContentInit(); } }
    const currVal_0:any = this.context._checked;
    if (import4.checkBinding(throwOnChange,this._expr_0,currVal_0)) {
      this.renderer.setElementClass(this._el_0,'checkbox-checked',currVal_0);
      this._expr_0 = currVal_0;
    }
    const currVal_1:any = this.context.id;
    if (import4.checkBinding(throwOnChange,this._expr_1,currVal_1)) {
      this.renderer.setElementProperty(this._el_2,'id',currVal_1);
      this._expr_1 = currVal_1;
    }
    const currVal_2:any = this.context._checked;
    if (import4.checkBinding(throwOnChange,this._expr_2,currVal_2)) {
      this.renderer.setElementAttribute(this._el_2,'aria-checked',((currVal_2 == (null as any))? (null as any): currVal_2.toString()));
      this._expr_2 = currVal_2;
    }
    const currVal_3:any = this.context._labelId;
    if (import4.checkBinding(throwOnChange,this._expr_3,currVal_3)) {
      this.renderer.setElementAttribute(this._el_2,'aria-labelledby',((currVal_3 == (null as any))? (null as any): currVal_3.toString()));
      this._expr_3 = currVal_3;
    }
    const currVal_4:any = this.context._disabled;
    if (import4.checkBinding(throwOnChange,this._expr_4,currVal_4)) {
      this.renderer.setElementAttribute(this._el_2,'aria-disabled',((currVal_4 == (null as any))? (null as any): currVal_4.toString()));
      this._expr_4 = currVal_4;
    }
    this.detectViewChildrenChanges(throwOnChange);
  }
}
export function viewFactory_Checkbox0(viewUtils:import4.ViewUtils,parentInjector:import5.Injector,declarationEl:import2.AppElement):import1.AppView<import3.Checkbox> {
  if ((renderType_Checkbox === (null as any))) { (renderType_Checkbox = viewUtils.createRenderComponentType('/Users/dan/Dev/ionic2-build/dist/ionic-angular/esm/components/checkbox/checkbox.ts class Checkbox - inline template',0,import13.ViewEncapsulation.None,styles_Checkbox,{})); }
  return new _View_Checkbox0(viewUtils,parentInjector,declarationEl);
}