問題タブ [angular-changedetection]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
301 問題
0
投票する
0
に答える
32
参照
angular - すべてのコンポーネントに ChangeDetectionStrategy.OnPush を配置してみませんか?
私が理解している限り、コンポーネントで宣言changeDetection: ChangeDetectionStrategy.OnPush
するということは、親の値が変更されたときに変更をチェックするのではなく、入力値の1つが具体的に変更されたときにのみ更新されることを意味します。その場合、なぜOnPush
デフォルト設定ではないのでしょうか。この動作が望ましくない場合はありますか?