File tree Expand file tree Collapse file tree 4 files changed +18
-17
lines changed
apps/angular/31-module-to-standalone/src Expand file tree Collapse file tree 4 files changed +18
-17
lines changed Original file line number Diff line number Diff line change 11import { Component } from '@angular/core' ;
2+ import { RouterLink , RouterOutlet } from '@angular/router' ;
23
34@Component ( {
45 selector : 'app-root' ,
@@ -25,6 +26,7 @@ import { Component } from '@angular/core';
2526 host : {
2627 class : 'flex flex-col p-4 gap-3' ,
2728 } ,
28- standalone : false ,
29+ standalone : true ,
30+ imports : [ RouterLink , RouterOutlet ] ,
2931} )
3032export class AppComponent { }
Original file line number Diff line number Diff line change 1+ import { provideToken } from '@angular-challenges/module-to-standalone/core/providers' ;
2+ import { ApplicationConfig } from '@angular/core' ;
3+ import { provideRouter , withComponentInputBinding } from '@angular/router' ;
4+ import { appRoutes } from 'libs/module-to-standalone/shell/src/lib/main-shell.routes' ;
5+
6+ export const appConfig : ApplicationConfig = {
7+ providers : [
8+ provideRouter ( appRoutes , withComponentInputBinding ( ) ) ,
9+ provideToken ( 'main-shell-token' ) ,
10+ ] ,
11+ } ;
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1- import { platformBrowserDynamic } from '@angular/platform-browser-dynamic' ;
2- import { AppModule } from './app/app.module' ;
1+ import { bootstrapApplication } from '@angular/platform-browser' ;
2+ import { AppComponent } from './app/app.component' ;
3+ import { appConfig } from './app/app.config' ;
34
4- platformBrowserDynamic ( )
5- . bootstrapModule ( AppModule )
6- . catch ( ( err ) => console . error ( err ) ) ;
5+ bootstrapApplication ( AppComponent , appConfig ) . catch ( ( e ) => console . error ( e ) ) ;
You can’t perform that action at this time.
0 commit comments