cost 60 ms
Angular ChangeDetectorRef 渲染實時數據

[英]Angular ChangeDetectorRef render live data

我正在嘗試獲取有關 angular 基本組件的實時數據。 我期望的是:HTML 渲染每 1 秒自動遞增一次(即:0、1、2、3、4、5..等) 我得到了什么:HTML 渲染:0 然后 1。(增加一次然后停止) Stackblitz url for demonstration (appologize ...

Angular 和 Plotly:提供數據的方法調用過於頻繁

[英]Angular and Plotly: Method that provides data get called too often

我在 Angular 組件中有一個非常簡單的 Plotly 圖: getTemperatureData()方法返回包含數據的 object - 標准過程。 但是,即使數據未更新,該方法也會被一遍又一遍地調用。 例如,將鼠標懸停在 Plotly 圖或 Angular 輸入字段上會觸發該方法。 有沒有 ...

Angular 如何通過以下方式檢測從父母到孩子的變化

[英]Angular how to detect changes from parent to child in the following way

示例組件的數據為 object 數組,並且其數組循環中有子組件。 樣本.組件 現在我需要檢測 object 上的任何值從父級更改時的更改 我無法獲得更改,因為數據不是輸入值。 如何獲得孩子的變化? StackBlitz注意:這只是示例代碼,在現實數據中有大量 arrays 的 object 具有多 ...

如何解決Angular中的“檢查錯誤后表達式更改”?

[英]How to solve the "Expression Changed After It Has Been Checked Error" in Angular?

我想在 Angular 中實現一個聊天。 聊天的每個項目(消息)都有一個標題(標題/名稱),應該有一個特定的邊距。 邊距應根據 div 的高度計算。 代碼看起來像這樣。 問題出在 Chrome 瀏覽器中(在 Mozilla 中沒有問題)。 控制台錯誤是:“ExpressionChangedAft ...

Angular 11 變更檢測問題

[英]Angular 11 change detection issue

我在我的 html 視圖中有一個情況,我正在更新材質滑塊的綁定,如下所示: 但是當我的孩子組件通過this.thresholdValueSub.next(value)調用一個服務來更新它時; ,我收到了經典的更改檢測錯誤: 我以為我會通過在我看來使用async來解決它,但我錯了: 然后 ...

在 Angular 中使用 changeDetection.markForCheck() 的正確方法是什么?

[英]What is the right way to use changeDetection.markForCheck() in Angular?

我正在使用markForCheck來檢測我的角度組件中的變化(其中有changeDetection: ChangeDetectionStrategy.OnPush ),最初,我將markForCheck放在函數的開頭, markForCheck我markForCheck ,然后我意識到放置它會更有意 ...

如何檢查組件中使用了哪個changedetectionStrategy

[英]How to check which changedetectionStrategy is used in component

有沒有辦法找出組件實際使用了哪個changedetectionStrategy。 我有一個非常大的 angular 應用程序,它在外部組件上使用 onPush,所以一切都應該使用 onPush。 但是當在一些子組件上額外應用 onPush 時,性能會有所提高。 該屏幕截圖顯示了當鼠標以幾乎完全相同 ...

我從子組件(timerrenderer)得到 ExpressionChangedAfterItHasBeenCheckedError,Angular 7

[英]I got ExpressionChangedAfterItHasBeenCheckedError from child compoenent (timerrenderer), Angular 7

我從我的子組件中收到 ExpressionChangedAfterItHasBeenCheckedError 錯誤。 我嘗試在 ngOnchanges 中添加 detectChanges() 方法,但沒有成功。 我是 angular 的新手。 我也嘗試了其他問題的解決方案,但對我不起作用。 ...

為什么我需要標記檢查? angular

[英]Why do I need mark for check ? angular

我正在使用 angular 10,cdktable,我面臨以下問題。 當我在表格上執行搜索時,除非我單擊應用程序中的任何位置(它神奇地更新),否則我的分頁不會更新... 這是一個變更檢測問題,我的應用程序正在使用 onPush 策略。 現在,我的表正在從這個 observable 中獲取數據con ...

Angular - 動態加載的模塊/組件中的更改檢測而不使用`ChangeDetectorRef`

[英]Angular - change detection in dynamically loaded module/component without using `ChangeDetectorRef`

我用編譯器的compileModuleAsync編譯了一個 Angular 模塊(動態加載模塊),並希望將模塊的一個組件插入到視圖中。 我試圖將組件插入到ViewContainer中,但該組件不會自動檢測到更改。 每次更新組件的屬性時,我都應該調用changeDetectorRef.detectC ...


 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM