Questions tagged [angular2-changedetection]

473 questions
-1
votes
2 answers

why every time constructor and ngOninit is called in angular when navigate to component?

** 1 .suppose a scenario like i am having navbar and there are tabs in that navbar home and login first when i do ng serve the component of home is called inside it constructor and ngOninit is also invoked . suppose now i navigate to the login…
-1
votes
1 answer

angular onpush component rerenders only with async pipe inside template

I have my component with ChangeDetectionStrategy.OnPush strategy. Im passing data from parent via async pipe, when that data change component refuse to rerender. When im instead of using async pipe in parent pass obvservable and use async pipe…
Konrad Albrecht
  • 1,701
  • 1
  • 9
  • 20
-1
votes
1 answer

Is there a difference in performance between logic in html expression and logic in a class property in an Angular template?

I know because of Angular change detection strategy it is less performant add functions in the component HTML, as the function will be called for every change detection cycle. But is there a difference between defining a simple comparison in the…
MartaGalve
  • 1,056
  • 3
  • 13
  • 34
-1
votes
2 answers

Angular Change Detection not triggered, parts of viewlayer not updating. ChangeDetectorRef not solving issue.

I have a component: import { Component, OnInit, Input, NgZone, ChangeDetectorRef } from '@angular/core'; import { Product } from '../product'; // data types import { PRODUCTS } from '../mock-products'; // database import { CartService } from…
-1
votes
1 answer

Angular2 Change Detection when app is first loaded

So when I first load my app only the static content is loaded i.e. the content where I have async pipes is not rendered at all (usually one that is supposed to be rendered after server response). Dynamic content only loads once I hover over a link…
sohel101091
  • 235
  • 1
  • 2
  • 10
-2
votes
4 answers

Reactive formcontrol triggers Change Detection

Reactive FormControl element triggers ChangeDetection whenever the input value is changed. I have added OnPush strategy but still it runs ChangeDetection, @Component({ selector: 'app-server-input', templateUrl: './server-input.component.html', …
anonymous
  • 1,499
  • 2
  • 18
  • 39
-2
votes
1 answer

Render realtime changes in Angular across the devices

I'm working on angular app. And I'm looking for rendering the updated list of users(table format) in real time across all the devices once a new user is added from any one of the given device. Any pointers or hints which could help me with this is…
AkshayP
  • 106
  • 1
  • 9
-3
votes
2 answers

How do I use static field for function in change detection cycle in Angular?

I want to use a static field instead of calling the function isCorrect(option.correct, i) on every CD cycle in my template. Please can you help me to do this. Thank you. My template's code looks like this:
integral100x
  • 332
  • 6
  • 20
  • 47
1 2 3
31
32