/**
 * 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 './toggle';
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 '../../util/form';
import * as import9 from '../../config/config';
import * as import10 from '@angular/core/src/linker/element_ref';
import * as import11 from '../item/item';
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_Toggle_Host:import0.RenderComponentType = (null as any);
class _View_Toggle_Host0 extends import1.AppView<any> {
  _el_0:any;
  /*private*/ _appEl_0:import2.AppElement;
  _Toggle_0_4:import3.Toggle;
  __NG_VALUE_ACCESSOR_0_5:any[];
  /*private*/ _expr_0:any;
  constructor(viewUtils:import4.ViewUtils,parentInjector:import5.Injector,declarationEl:import2.AppElement) {
    super(_View_Toggle_Host0,renderType_Toggle_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._Toggle_0_4]); }
    return this.__NG_VALUE_ACCESSOR_0_5;
  }
  createInternal(rootSelector:string):import2.AppElement {
    this._el_0 = this.selectOrCreateHostElement('ion-toggle',rootSelector,(null as any));
    this._appEl_0 = new import2.AppElement(0,(null as any),this,this._el_0);
    var compView_0:any = viewFactory_Toggle0(this.viewUtils,this.injector(0),this._appEl_0);
    this._Toggle_0_4 = new import3.Toggle(this.parentInjector.get(import8.Form),this.parentInjector.get(import9.Config),new import10.ElementRef(this._el_0),this.renderer,this.parentInjector.get(import11.Item,(null as any)));
    this._appEl_0.initComponent(this._Toggle_0_4,[],compView_0);
    compView_0.create(this._Toggle_0_4,this.projectableNodes,(null as any));
    this._expr_0 = import7.UNINITIALIZED;
    this.init([].concat([this._el_0]),[this._el_0],[],[]);
    return this._appEl_0;
  }
  injectorGetInternal(token:any,requestNodeIndex:number,notFoundResult:any):any {
    if (((token === import3.Toggle) && (0 === requestNodeIndex))) { return this._Toggle_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._Toggle_0_4.ngAfterContentInit(); } }
    const currVal_0:any = this._Toggle_0_4._disabled;
    if (import4.checkBinding(throwOnChange,this._expr_0,currVal_0)) {
      this.renderer.setElementClass(this._el_0,'toggle-disabled',currVal_0);
      this._expr_0 = currVal_0;
    }
    this.detectViewChildrenChanges(throwOnChange);
  }
  destroyInternal():void {
    this._Toggle_0_4.ngOnDestroy();
  }
}
function viewFactory_Toggle_Host0(viewUtils:import4.ViewUtils,parentInjector:import5.Injector,declarationEl:import2.AppElement):import1.AppView<any> {
  if ((renderType_Toggle_Host === (null as any))) { (renderType_Toggle_Host = viewUtils.createRenderComponentType('',0,import13.ViewEncapsulation.None,[],{})); }
  return new _View_Toggle_Host0(viewUtils,parentInjector,declarationEl);
}
export const ToggleNgFactory:import14.ComponentFactory<import3.Toggle> = new import14.ComponentFactory<import3.Toggle>('ion-toggle',viewFactory_Toggle_Host0,import3.Toggle);
const styles_Toggle:any[] = [];
var renderType_Toggle:import0.RenderComponentType = (null as any);
class _View_Toggle0 extends import1.AppView<import3.Toggle> {
  _el_0:any;
  _el_1:any;
  _el_2:any;
  /*private*/ _appEl_2:import2.AppElement;
  _Button_2_4:import15.Button;
  /*private*/ _expr_0:any;
  /*private*/ _expr_1:any;
  /*private*/ _expr_2:any;
  /*private*/ _expr_3:any;
  /*private*/ _expr_4:any;
  /*private*/ _expr_5:any;
  constructor(viewUtils:import4.ViewUtils,parentInjector:import5.Injector,declarationEl:import2.AppElement) {
    super(_View_Toggle0,renderType_Toggle,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','toggle-icon');
    this._el_1 = this.renderer.createElement(this._el_0,'div',(null as any));
    this.renderer.setElementAttribute(this._el_1,'class','toggle-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(import9.Config),new import10.ElementRef(this._el_2),this.renderer);
    this._appEl_2.initComponent(this._Button_2_4,[],compView_2);
    compView_2.create(this._Button_2_4,[[]],(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._expr_5 = import7.UNINITIALIZED;
    this.init([],[
      this._el_0,
      this._el_1,
      this._el_2
    ]
    ,[],[]);
    return (null as any);
  }
  injectorGetInternal(token:any,requestNodeIndex:number,notFoundResult:any):any {
    if (((token === import15.Button) && (2 === requestNodeIndex))) { 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,'toggle-checked',currVal_0);
      this._expr_0 = currVal_0;
    }
    const currVal_1:any = this.context._activated;
    if (import4.checkBinding(throwOnChange,this._expr_1,currVal_1)) {
      this.renderer.setElementClass(this._el_0,'toggle-activated',currVal_1);
      this._expr_1 = currVal_1;
    }
    const currVal_2:any = this.context.id;
    if (import4.checkBinding(throwOnChange,this._expr_2,currVal_2)) {
      this.renderer.setElementProperty(this._el_2,'id',currVal_2);
      this._expr_2 = currVal_2;
    }
    const currVal_3:any = this.context._checked;
    if (import4.checkBinding(throwOnChange,this._expr_3,currVal_3)) {
      this.renderer.setElementAttribute(this._el_2,'aria-checked',((currVal_3 == (null as any))? (null as any): currVal_3.toString()));
      this._expr_3 = currVal_3;
    }
    const currVal_4:any = this.context._labelId;
    if (import4.checkBinding(throwOnChange,this._expr_4,currVal_4)) {
      this.renderer.setElementAttribute(this._el_2,'aria-labelledby',((currVal_4 == (null as any))? (null as any): currVal_4.toString()));
      this._expr_4 = currVal_4;
    }
    const currVal_5:any = this.context._disabled;
    if (import4.checkBinding(throwOnChange,this._expr_5,currVal_5)) {
      this.renderer.setElementAttribute(this._el_2,'aria-disabled',((currVal_5 == (null as any))? (null as any): currVal_5.toString()));
      this._expr_5 = currVal_5;
    }
    this.detectViewChildrenChanges(throwOnChange);
  }
}
export function viewFactory_Toggle0(viewUtils:import4.ViewUtils,parentInjector:import5.Injector,declarationEl:import2.AppElement):import1.AppView<import3.Toggle> {
  if ((renderType_Toggle === (null as any))) { (renderType_Toggle = viewUtils.createRenderComponentType('/Users/adam/git/ionic2/dist/ionic-angular/components/toggle/toggle.ts class Toggle - inline template',0,import13.ViewEncapsulation.None,styles_Toggle,{})); }
  return new _View_Toggle0(viewUtils,parentInjector,declarationEl);
}