fix(ivy): ngOnChanges only runs for binding updates (#27965)
PR Close #27965
This commit is contained in:
@ -6,8 +6,9 @@
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
import {ViewEncapsulation} from '../../core';
|
||||
import {SimpleChanges, ViewEncapsulation} from '../../core';
|
||||
import {Type} from '../../interface/type';
|
||||
|
||||
import {CssSelectorList} from './projection';
|
||||
|
||||
|
||||
@ -150,6 +151,7 @@ export interface DirectiveDef<T> extends BaseDef<T> {
|
||||
/* The following are lifecycle hooks for this component */
|
||||
onInit: (() => void)|null;
|
||||
doCheck: (() => void)|null;
|
||||
onChanges: ((changes: SimpleChanges) => void)|null;
|
||||
afterContentInit: (() => void)|null;
|
||||
afterContentChecked: (() => void)|null;
|
||||
afterViewInit: (() => void)|null;
|
||||
|
@ -464,10 +464,12 @@ export type PropertyAliases = {
|
||||
/**
|
||||
* Store the runtime input or output names for all the directives.
|
||||
*
|
||||
* - Even indices: directive index
|
||||
* - Odd indices: minified / internal name
|
||||
* Values are stored in triplets:
|
||||
* - i + 0: directive index
|
||||
* - i + 1: minified / internal name
|
||||
* - i + 2: declared name
|
||||
*
|
||||
* e.g. [0, 'change-minified']
|
||||
* e.g. [0, 'minifiedName', 'declaredPropertyName']
|
||||
*/
|
||||
export type PropertyAliasValue = (number | string)[];
|
||||
|
||||
@ -495,10 +497,12 @@ export type InitialInputData = (InitialInputs | null)[];
|
||||
* Used by InitialInputData to store input properties
|
||||
* that should be set once from attributes.
|
||||
*
|
||||
* Even indices: minified/internal input name
|
||||
* Odd indices: initial value
|
||||
* The inputs come in triplets of:
|
||||
* i + 0: minified/internal input name
|
||||
* i + 1: declared input name (needed for OnChanges)
|
||||
* i + 2: initial value
|
||||
*
|
||||
* e.g. ['role-min', 'button']
|
||||
* e.g. ['minifiedName', 'declaredName', 'value']
|
||||
*/
|
||||
export type InitialInputs = string[];
|
||||
|
||||
|
@ -6,12 +6,12 @@
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
import {SimpleChanges} from '../../change_detection/simple_change';
|
||||
import {InjectionToken} from '../../di/injection_token';
|
||||
import {Injector} from '../../di/injector';
|
||||
import {Type} from '../../interface/type';
|
||||
import {QueryList} from '../../linker';
|
||||
import {Sanitizer} from '../../sanitization/security';
|
||||
|
||||
import {LContainer} from './container';
|
||||
import {ComponentDef, ComponentQuery, ComponentTemplate, DirectiveDef, DirectiveDefList, HostBindingsFunction, PipeDef, PipeDefList} from './definition';
|
||||
import {I18nUpdateOpCodes, TI18n} from './i18n';
|
||||
@ -22,7 +22,6 @@ import {RElement, Renderer3, RendererFactory3} from './renderer';
|
||||
import {StylingContext} from './styling';
|
||||
|
||||
|
||||
|
||||
// Below are constants for LView indices to help us look up LView members
|
||||
// without having to remember the specific indices.
|
||||
// Uglify will inline these when minifying so there shouldn't be a cost.
|
||||
@ -533,7 +532,7 @@ export interface RootContext {
|
||||
* Even indices: Directive index
|
||||
* Odd indices: Hook function
|
||||
*/
|
||||
export type HookData = (number | (() => void))[];
|
||||
export type HookData = (number | (() => void) | ((changes: SimpleChanges) => void))[];
|
||||
|
||||
/**
|
||||
* Static data that corresponds to the instance-specific data array on an LView.
|
||||
|
Reference in New Issue
Block a user