From 539901da835d271b302c64e7e889bb32c1eba070 Mon Sep 17 00:00:00 2001 From: Manuel Mtz-Almeida Date: Fri, 28 Apr 2017 17:23:36 +0200 Subject: [PATCH] fix(toggle): initialize at ngAfterContentInit --- src/components/toggle/toggle.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/toggle/toggle.ts b/src/components/toggle/toggle.ts index f92400a374c..81dbe9ed833 100644 --- a/src/components/toggle/toggle.ts +++ b/src/components/toggle/toggle.ts @@ -1,4 +1,4 @@ -import { NgZone, AfterViewInit, ChangeDetectorRef, Component, ElementRef, HostListener, Input, OnDestroy, Optional, Renderer, ViewEncapsulation } from '@angular/core'; +import { AfterContentInit, NgZone, ChangeDetectorRef, Component, ElementRef, HostListener, Input, OnDestroy, Optional, Renderer, ViewEncapsulation } from '@angular/core'; import { NG_VALUE_ACCESSOR } from '@angular/forms'; import { Config } from '../../config/config'; @@ -73,7 +73,7 @@ import { ToggleGesture } from './toggle-gesture'; providers: [ { provide: NG_VALUE_ACCESSOR, useExisting: Toggle, multi: true } ], encapsulation: ViewEncapsulation.None, }) -export class Toggle extends BaseInput implements IonicTapInput, AfterViewInit, OnDestroy { +export class Toggle extends BaseInput implements IonicTapInput, AfterContentInit, OnDestroy { _activated: boolean = false; _startX: number; @@ -111,7 +111,7 @@ export class Toggle extends BaseInput implements IonicTapInput, AfterVi /** * @hidden */ - ngAfterViewInit() { + ngAfterContentInit() { this._initialize(); this._gesture = new ToggleGesture(this._plt, this, this._gestureCtrl, this._domCtrl); this._gesture.listen();