For questions regarding Angular specific to version 16. Please include all relevant tags on your question; e.g., [Angular], [TypeScript], etc.
Questions tagged [angular16]
120 questions
6
votes
2 answers
routerLink change in Angular 16
When using angular < 16, I used to have this routes configuration:
{
path: Section.Security,
canActivate: [AuthGuard, AccessGuard, AdminGuard],
children: [
{
path: '',
pathMatch: 'full',
redirectTo: 'administrators'
…

ssougnez
- 5,315
- 11
- 46
- 79
5
votes
1 answer
inject in standalone component fails if moved to an npm library
I created a simple angular standalone component that uses an injection token for configuration:
export const PERSON_DEFAULT_OPTIONS = new InjectionToken('...')
export interface IPersonDefaults { ... }
export const…

Gargoyle
- 9,590
- 16
- 80
- 145
4
votes
1 answer
Production build fail after Angular upgrade document.documentElement.setAttribute is not a function
I have upgraded my application to Angular 16 and upgrade went well and application is working as expected
But when I run the command for prod build
ng build --configuration=production
I got this error
Index html generation…

ani.lava
- 69
- 6
4
votes
1 answer
How does Angular Signals affect RXJS Observables and what happens to change detection in this case
I am trying to switch to Signals in my Angular App and i currently have issues finding good practices and i also experienced (at least for me) unexpected behaviour.
This is a snippet of my code consisting of a userService and two Components
export…

Tilman Adam
- 41
- 3
4
votes
2 answers
ngx-virtual-scroll is not working after angular16 updation
ngx-virtual-scroll is not working after angular16 updation, showing one error in the terminal.
The error is
'VirtualScrollerModule' does not appear to be an NgModule class.
This likely means that the library (ngx-virtual-scroller) which declares…

Vinu Ram
- 109
- 6
4
votes
1 answer
Is there any sense already for using signals in Angular?
According to RFC3 signal-based components with change detection strategy based fully on signals are planned as next thing to be released. So as of now, with zone-based change detection strategy, is there any sense of using signals over the…

ThaFog
- 493
- 3
- 15
3
votes
0 answers
specify that import @foo/bar will go search in projects/foo/src/public-api.ts in angular16 cli project
I'm writing an angular cli 16.2.0 project and i encounter the following problem:
i created a workspace, lets call it test
# ng new test --no-create-application
i created a library project called foo and an application project called foo-app using…

ufk
- 30,912
- 70
- 235
- 386
3
votes
1 answer
Angular Signals - debounce in effect()
I have a signal that is bound to an input field. I'm trying to define an effect() for the searchTerm, but because it's user input, I'd like to debounce that effect (i.e. rxjs) so that the search doesn't happen with each keystroke. I'm unclear on how…

Layne Robinson
- 33
- 3
3
votes
1 answer
Update from angular 11 to Angular 16 resulted in builds taking hours to complete
I have an ngular project that was in angular 11 and we started updating it to angular 16, this project has 3 libraries that continued very fast to build, and when I use this libraries in the angular application, the build is extremely slow, taking…

Luiz Bicalho
- 813
- 1
- 12
- 30
3
votes
6 answers
How to use CanActivateFn in Angular 16 via constructor dependency injection
How can I make use of the latest CanActivateFn in Angular 16 with DI?
The recent Angular 16 uses a function, not a class, for the canactivate functionality.
This is my code below. How can I add my DI's that would normally be in the constructor in…

joseph chikeme
- 184
- 1
- 12
2
votes
1 answer
Cannot listen to an event multiple times on a single element
I cannot listen to an event multiple times on a single element.
I have noted following :
This issue occurs only when firing an RxJS observable from a lifecycle methods like ngAfterViewChecked, ngDoCheck or from the new afterRender() hook.
When…

Matthieu Riegler
- 31,918
- 20
- 95
- 134
2
votes
2 answers
Angular 16 component export from a shared module not working
I have created a shared module for my project in Angular 16 and exporting it. Problem is when I am importing this to app.module.ts, it's working as expected. But when I import this to dashboard.module.ts, it's giving following error -
Error:…

AffiliateVDev
- 41
- 5
2
votes
2 answers
Problem while updating angular 8 to angular 16. Error: Cant bind to "something" since it isn't a known property of "something"
I am updating an old angular 8 project to angular 16. I have updated the project. But now compiling the project is giving me multiple error on components "Cant bind to "something" since it isn't a known property of "something",where "something" here…

Enter-The-Matrix
- 21
- 2
2
votes
0 answers
why angular material components became unknown elements after upgrade to Angular 16
I encountered a problem with material components after I have upgraded Angular project from version 15 into version 16. Namely some of elements like mat-form-field, mat-label, mat-select caused errors: error NG8001: 'mat-label' is not a known…

Kianni
- 46
- 4
2
votes
1 answer
Angular 16 Can't bind to 'ng*'(ngClass, ngStyle, ngSwitch) since it isn't a known property of 'div'
I recently migrated to Angular 16 a business used application. After migration I have received error Can't bind to 'ngClass' since it isn't a known property of 'div'. The error is a compilation error which doesn't allow the application to run.
I…

AVB
- 21
- 2