mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-21 13:01:01 +08:00
refactor: improve tree shaking abilities
Internal refactor completed in order to improve tree shaking and dead code removal. The public API, with an exception to ion-slides, has stayed the same. However, internally many changes were required so bundlers could better exclude modules which should not be bundled. Ultimately most changes resorted to removing references to `window` or `document`, or a module that referenced one of those. BREAKING CHANGES ion-slides was refactored to remove the external dependencies, and rewritten in TypeScript/ES6 modules to again improve tree shaking abilities.
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
import { AfterContentInit, Component, ElementRef, EventEmitter, forwardRef, HostListener, Input, OnDestroy, Optional, Output, Renderer, ViewEncapsulation } from '@angular/core';
|
||||
import { AfterContentInit, ChangeDetectorRef, Component, ElementRef, EventEmitter, forwardRef, HostListener, Input, OnDestroy, Optional, Output, Renderer, ViewEncapsulation } from '@angular/core';
|
||||
import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';
|
||||
|
||||
import { Config } from '../../config/config';
|
||||
@ -95,7 +95,7 @@ export class Checkbox extends Ion implements IonicTapInput, AfterContentInit, Co
|
||||
}
|
||||
|
||||
/**
|
||||
* @input {string} The mode to apply to this component.
|
||||
* @input {string} The mode to apply to this component. Mode can be `ios`, `wp`, or `md`.
|
||||
*/
|
||||
@Input()
|
||||
set mode(val: string) {
|
||||
@ -112,7 +112,8 @@ export class Checkbox extends Ion implements IonicTapInput, AfterContentInit, Co
|
||||
private _form: Form,
|
||||
@Optional() private _item: Item,
|
||||
elementRef: ElementRef,
|
||||
renderer: Renderer
|
||||
renderer: Renderer,
|
||||
private _cd: ChangeDetectorRef
|
||||
) {
|
||||
super(config, elementRef, renderer, 'checkbox');
|
||||
|
||||
@ -208,6 +209,7 @@ export class Checkbox extends Ion implements IonicTapInput, AfterContentInit, Co
|
||||
console.debug('checkbox, onChange (no ngModel)', isChecked);
|
||||
this._setChecked(isChecked);
|
||||
this.onTouched();
|
||||
this._cd.detectChanges();
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user