Angular Revisited 2025: Difference between revisions
Jump to navigation
Jump to search
Created page with "=Introduction= Been a while since I touched Angular except for when I put my loader into WASM. So this page is just to add any changes I have found =CommonModule= The structural directives, e.g. NgFor NgIf not can be import in the component. I guessing the is because of SSR so now we do this <syntaxhighlight lang="ts"> @Component({ selector: 'app-chess-board', imports: [NgFor, NgClass, NgIf], templateUrl: './chess-board.component.html', styleUrl: './chess-board.c..." |
No edit summary |
||
Line 15: | Line 15: | ||
=Assests= | =Assests= | ||
These now live in the public directory. I wonder if the is something to copy them from there old haught of src. | These now live in the public directory. I wonder if the is something to copy them from there old haught of src. | ||
=Modules now Providers= | |||
There is no app.modules.ts anymore but I believe you can make one. The new way is to edit the app.config.ts. We don't import modules but providers which do the same job. | |||
<syntaxhighlight lang="ts"> | |||
export const appConfig: ApplicationConfig = { | |||
providers: [ | |||
provideZoneChangeDetection({ eventCoalescing: true }), | |||
provideRouter(routes), | |||
provideHttpClient()] | |||
}; | |||
</syntaxhighlight> |
Latest revision as of 03:04, 20 March 2025
Introduction
Been a while since I touched Angular except for when I put my loader into WASM. So this page is just to add any changes I have found
CommonModule
The structural directives, e.g. NgFor NgIf not can be import in the component. I guessing the is because of SSR so now we do this
@Component({
selector: 'app-chess-board',
imports: [NgFor, NgClass, NgIf],
templateUrl: './chess-board.component.html',
styleUrl: './chess-board.component.css'
})
export class ChessBoardComponent {
...
Assests
These now live in the public directory. I wonder if the is something to copy them from there old haught of src.
Modules now Providers
There is no app.modules.ts anymore but I believe you can make one. The new way is to edit the app.config.ts. We don't import modules but providers which do the same job.
export const appConfig: ApplicationConfig = {
providers: [
provideZoneChangeDetection({ eventCoalescing: true }),
provideRouter(routes),
provideHttpClient()]
};