mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-20 12:29:55 +08:00
fix(toggle): initialize at ngAfterContentInit
This commit is contained in:
@ -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<boolean> implements IonicTapInput, AfterViewInit, OnDestroy {
|
||||
export class Toggle extends BaseInput<boolean> implements IonicTapInput, AfterContentInit, OnDestroy {
|
||||
|
||||
_activated: boolean = false;
|
||||
_startX: number;
|
||||
@ -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();
|
||||
|
Reference in New Issue
Block a user