Questions tagged [angular-changedetection]

Used for questions regarding Angular's change detection routines.

As opposed to AngularJS's digest cycles, Angular uses change detection which occurs in zones (see NgZone). Questions regarding this process, how it differs from AngularJS's digest cycle, how microtasks work, etc., are all applicable to this tag.

353 questions
0
votes
0 answers

Angular - Change detection inside Service

I'm working on an Angular application. I need to listen to changes in a dataset (javascript object) inside one of my services. I'm familiar with Angular's KeyValueDiffers (listener on Objects) and with IterableDiffers (listener on Arrays). And if I…
Gil Epshtain
  • 8,670
  • 7
  • 63
  • 89
0
votes
0 answers

Angular6 long waiting to change

I've updated my Angular app to Angular6. I noticed that my components which are for example displaying data from Observable using pipes are stuck. I mean that they are working, but I have to wait a very long time to auto-update this component. For…
Maciej Wojcik
  • 2,115
  • 2
  • 28
  • 47
0
votes
0 answers

Did Change Detection Strategy Change in Angular 5?

I am trying to understand the advantage of using ChangeDetectionStrategy.OnPush. So wrote some components in basic example where OnPush stategy might help. Stackblits: https://stackblitz.com/edit/angular-stgymt App Co html:

{{title}}

Vugar Abdullayev
  • 1,852
  • 3
  • 21
  • 46
0
votes
1 answer

How to get checkbox click event on change

how to get checkbox click event on the change in angular 5 i have used the following code html code option …
0
votes
0 answers

Angular 2+ Expression has changed after it was checked

I know there are several threads on this issue, but the proposed fixes are not working for me. The data appears correctly then soon dissappears. From what I understand, a round of change detection needs to be activated. I have used: …
Ryn9011
  • 179
  • 2
  • 17
0
votes
2 answers

Angular2/4 changeDectorRef not working

I have a navbar component, inside its ngOnInit function I have checked if user is logged in or not, if the user is logged in then I change isAuthorized to true, and its default is false, then I check with *ngIf="isAuthorized", in my menu lis. Now…
jones
  • 1,423
  • 3
  • 35
  • 76
0
votes
0 answers

Angular Show Container Based on Property in Object Array

I currently have a div in my Angular component template that should only be toggled if at least one objects properties in an object array is set to true. For example: var object = { property: true || false }; I'm currently doing something like…
User 5842
  • 2,849
  • 7
  • 33
  • 51
0
votes
1 answer

Updating ng-charts barchart datasets in angular 2

How to update barchart from angular2? I am trying to add new entry on click to [datasets]="barChartData" In template, graph looks like this:
playerone
  • 987
  • 3
  • 22
  • 44
-1
votes
1 answer

How to show assign value in form group get from api object

I am working on edit functionality in angular 14. My requirments are bit diff thats why i am not using set value to assign value in form . I have get the value from api in the form of model export class EditCandidateComponent implements OnInit { …
-1
votes
1 answer

Why is ChangeDetection triggered on Mat-Table header hover (despite using OnPush)

I'm having performance problems with a mat-table triggering change detections despite using OnPush. Here is a working example : https://stackblitz.com/edit/angular-bjouzc?file=src%2Fapp%2Fapp.component.ts When hovering the header cells, you will see…
-1
votes
1 answer

Is change detection in Angular triggered by @Input changes also?

This site says: In the default change detection strategy, Angular will run the change detector any time @Input() data is changed or modified But in reality, change detection is triggered only on the following three conditions (as the same site…
Daud
  • 7,429
  • 18
  • 68
  • 115
-1
votes
1 answer

The dom is not reflective of the actual value wen using onPush strategy with ngrx store subscription

component file: // Angular and 3rd party libs imports import { ChangeDetectionStrategy, Component, OnInit } from '@angular/core'; import { Store } from '@ngrx/store'; import { UntilDestroy, untilDestroyed } from '@ngneat/until-destroy'; //…
-1
votes
1 answer

Getting wrong total value because of multiple change deduction how to prevent?

I am getting wrong value, because of multiple change deduction. how to prevent? app.component.ts : import { Component, OnInit } from "@angular/core"; interface PropsData { productName: string; value: number; count: number; details: (value1:…
user2024080
  • 1
  • 14
  • 56
  • 96
-1
votes
2 answers

Angular change detection, when calling a function from template

I have just called a function from a template and inside that I am simply returning true or false; https://stackblitz.com/edit/angular-ivy-awrmsl?file=src%2Fapp%2Fapp.component.ts Check the console of above link project, so array has 7 items but in…
LogicBlower
  • 1,250
  • 1
  • 8
  • 14
-1
votes
1 answer

Angular - Handle multiple child component in parent component conditionally

I have a set of different child views which I require to be loaded on a condition. Everything works fine however, I receive a message that ViewDestroyedError: Attempt to use a destroyed view: detectChanges. So I believe that this is causing that on…
Khilen Maniyar
  • 2,519
  • 7
  • 31
  • 35
1 2 3
23
24