(11) [{…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}]
installHook.js:1 ERROR RuntimeError: NG0100: ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. Previous value: 'undefined'. Current value: 'can_accessDashboard'. Expression location: _Dashboard component It seems like the view has been created after its parent and its children have been dirty checked. Has it been created in a change detection hook? Find more at https://v21.angular.dev/errors/NG0100
at Dashboard_For_12_Template (component?c=src%2Fap…1770823049874:27:19)
dashboard.ts:46
(4) [{…}, {…}, {…}, {…}]
installHook.js:1 ERROR RuntimeError: NG0100: ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. Previous value: 'undefined'. Current value: 'Developer'. Expression location: _Dashboard component It seems like the view has been created after its parent and its children have been dirty checked. Has it been created in a change detection hook? Find more at https://v21.angular.dev/errors/NG0100
at Dashboard_For_8_Template (component?c=src%2Fap…1770823049874:15:19)
dashboard.ts:56
{roles: Array(4)}
installHook.js:1 ERROR RuntimeError: NG0100: ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. Previous value: 'undefined'. Current value: 'Developer'. Expression location: _Dashboard component It seems like the view has been created after its parent and its children have been dirty checked. Has it been created in a change detection hook? Find more at https://v21.angular.dev/errors/NG0100
at Dashboard_For_8_Template (component?c=src%2Fap…1770823049874:15:19)
Стек:
Angular v21
Laravel v12
Sanctum
Spatie для системы разрешений и ролей
Данные заполнителя
Бэкенд правильно отправляет данные, например:
Я использую Laravel в качестве REST API. Мой интерфейс должен отображать [list] [*]Все разрешения [*]Все роли [*]Все роли с их конкретными разрешениями [/list] Мои ошибки (F12) [code](11) [{…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}] installHook.js:1 ERROR RuntimeError: NG0100: ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. Previous value: 'undefined'. Current value: 'can_accessDashboard'. Expression location: _Dashboard component It seems like the view has been created after its parent and its children have been dirty checked. Has it been created in a change detection hook? Find more at https://v21.angular.dev/errors/NG0100 at Dashboard_For_12_Template (component?c=src%2Fap…1770823049874:27:19) dashboard.ts:46 (4) [{…}, {…}, {…}, {…}] installHook.js:1 ERROR RuntimeError: NG0100: ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. Previous value: 'undefined'. Current value: 'Developer'. Expression location: _Dashboard component It seems like the view has been created after its parent and its children have been dirty checked. Has it been created in a change detection hook? Find more at https://v21.angular.dev/errors/NG0100 at Dashboard_For_8_Template (component?c=src%2Fap…1770823049874:15:19) dashboard.ts:56 {roles: Array(4)} installHook.js:1 ERROR RuntimeError: NG0100: ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. Previous value: 'undefined'. Current value: 'Developer'. Expression location: _Dashboard component It seems like the view has been created after its parent and its children have been dirty checked. Has it been created in a change detection hook? Find more at https://v21.angular.dev/errors/NG0100 at Dashboard_For_8_Template (component?c=src%2Fap…1770823049874:15:19)
[/code] Что я пробовал: [list] [*]поместите мой getAllPerms() в конструктор. [*]Поместите мой getAllPerms() в ngAfterContentInit. [*]Воспроизведите мой getAllPerms() в setTimeout. [/list] [list] [*][code]setTimeout(() => { this.getAllPerms(); }, 0);[/code] [*]Данные отображаются правильно, но тем не менее ошибки в моей консоли появляются [/list] [list] [*]Использование ngAfterContentInit() вместо ngOnInit() [/list]