Skip to content

Commit

Permalink
fix(toggle): initialize at ngAfterContentInit
Browse files Browse the repository at this point in the history
  • Loading branch information
manucorporat committed Apr 28, 2017
1 parent 7eb2f0b commit 539901d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/components/toggle/toggle.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -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<boolean> implements IonicTapInput, AfterViewInit, OnDestroy {
export class Toggle extends BaseInput<boolean> implements IonicTapInput, AfterContentInit, OnDestroy {

_activated: boolean = false;
_startX: number;
Expand Down Expand Up @@ -111,7 +111,7 @@ export class Toggle extends BaseInput<boolean> implements IonicTapInput, AfterVi
/**
* @hidden
*/
ngAfterViewInit() {
ngAfterContentInit() {
this._initialize();
this._gesture = new ToggleGesture(this._plt, this, this._gestureCtrl, this._domCtrl);
this._gesture.listen();
Expand Down

1 comment on commit 539901d

@mcwienczek
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this closes #8070. After upgrade to 3.1.1 the issue is not loger reproductible.

Please sign in to comment.