+ details works! +
+ `, + styles: `` +}) +export class Details { + +} diff --git a/first-app/src/app/routes.ts b/first-app/src/app/routes.ts new file mode 100644 index 0000000..19dd23d --- /dev/null +++ b/first-app/src/app/routes.ts @@ -0,0 +1,17 @@ +import {Routes} from '@angular/router'; +import {Home} from './home/home'; +import {Details} from './details/details'; + +const routeConfig: Routes = [ + { + path: '', + component: Home, + title: 'Home page', + }, + { + path: 'details/:id', + component: Details, + title: 'Home details', + }, +]; +export default routeConfig; \ No newline at end of file diff --git a/first-app/src/main.ts b/first-app/src/main.ts index 4093863..fd204be 100644 --- a/first-app/src/main.ts +++ b/first-app/src/main.ts @@ -4,7 +4,8 @@ */ import {bootstrapApplication, provideProtractorTestingSupport} from '@angular/platform-browser'; import {App} from './app/app'; - -bootstrapApplication(App, {providers: [provideProtractorTestingSupport()]}).catch((err) => - console.error(err), -); +import {provideRouter} from '@angular/router'; +import routeConfig from './app/routes'; +bootstrapApplication(App, { + providers: [provideProtractorTestingSupport(), provideRouter(routeConfig)], +}).catch((err) => console.error(err)); \ No newline at end of file