question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItΒ collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

core: async observable update not triggering change detection in ejs-grid e-column directive.

See original GitHub issue

🐞 bug report

In angular 9, ngx-translate is not working as expected.

Is this a regression?

yes, working fine in angular 8

Description

while using ngx-translate to translate text, it return empty string as text but working fine in angular 8.

src\app\components\grid.component.html

<ejs-grid #grid [dataSource]="items" allowPaging="true" allowSorting="true" allowMultiSorting="true" (dataStateChange)="dataStateChange($event)" [locale]="locale" [pageSettings]="pageSettings">
    <e-columns>
      <e-column field="displayValue" headerText="{{'GRID.DISPLAYVALUE' | translate}}" width="80"></e-column>
      <e-column width="30" headerText="afaf" textAlign="center">
        <ng-template #template let-data>  
          <a (click)="delete(data.keyValue)">Delete</a>
        </ng-template>
      </e-column>
    </e-columns>
  </ejs-grid>

πŸ”¬ Minimal Reproduction

1.download below sample ngTranslateSampleIssue-712573671.zip

  1. Give npm i
  2. Then ng serve

you will see below in browser page. no header text

image

πŸ”₯ Exception or Error

headertext property has null value in component level hook.

🌍 Your Environment

Angular Version:


dependencies": {
    "@angular/animations": "9.0.4",
    "@angular/common": "9.0.4",
    "@angular/compiler": "9.0.4",
    "@angular/core": "9.0.4",
    "@angular/forms": "9.0.4",
    "@angular/platform-browser": "9.0.4",
    "@angular/platform-browser-dynamic": "9.0.4",
    "@angular/router": "9.0.4",
    "@ngx-translate/core": "^11.0.1",
    "@ngx-translate/http-loader": "^4.0.0",

Anything else relevant? my component life cycle hooks gets triggered from angular core level, in there my header-text property alue is null when i use translate like below

<e-column field="displayValue" headerText="{{'GRID.DISPLAYVALUE' | translate}}" width="80"></e-column>

Refer below image

image

Declare below in component.ts file

public check : any= {check:'check1',check2:'check2'};

and declare like below <e-column field="displayValue" headerText="{{check.check}}" width="80"></e-column>

it return my header text vale like below image

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:20 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
petebacondarwincommented, Apr 14, 2020

Looking some more…

1reaction
AndrewKushnircommented, Apr 8, 2020

Hi @kumaresan-subramani, thanks for reporting the issue.

Could you please help create a minimum possible repro, so that it’s easier to debug? Ideally it should be a couple components with simple templates that contain only the content needed to repro the issue. Once the repro is ready, pleased create a Github repo with the demo app and we’ll perform additional investigation.

Thank you.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Change detection not firing - angular - Stack Overflow
The Change Detection is triggered automatically by angular when an input/output changes. You can decide which component gets updated ...
Read more >
angular settimeout to update select async - You.com
angular/angularcore: async observable update not triggering change detection in ejs-grid e-column directive.#36503. Created over 2 years ago.
Read more >
"Seeing" Angular Change Detection in Action Part II: OnPush ...
Observable s returned by the Matrix2x2Service and uses the async pipe to update its view. Notice how as we interact with one component,...
Read more >
Observables in Angular Grid component - Syncfusion
The async pipe is used to subscribe the observable object and resolve with the latest value emitted by it. Data binding. The grid...
Read more >
When to use the subscribe method or async pipe in Angular?
Using the async pipe; By subscribing to the observable using the subscribe() ... To refresh, Angular has two Change Detection strategies.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found