angular/devtools/projects/demo-standalone/src/main.ts
AleksanderBodurri dbadfea67f feat(devtools): create demo application that uses standalone APIs and standalone components/directives/pipes (#48533)
The existing DevTools demo app that is used for developing on DevTools is exclusively an NgModule application. This commit creates a copy of the old demo app but with no NgModules and only standalone APIs/Components/Directives/Pipes

PR Close #48533
2023-06-12 12:51:24 +02:00

44 lines
1.3 KiB
TypeScript

/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import {bootstrapApplication} from '@angular/platform-browser';
import {provideAnimations} from '@angular/platform-browser/animations';
import {provideRouter} from '@angular/router';
import {ApplicationEnvironment, ApplicationOperations} from 'ng-devtools';
import {DemoApplicationEnvironment} from '../../../src/demo-application-environment';
import {DemoApplicationOperations} from '../../../src/demo-application-operations';
import {AppComponent} from './app/app.component';
bootstrapApplication(AppComponent, {
providers: [
provideAnimations(),
provideRouter([
{
path: '',
loadComponent: () =>
import('./app/devtools-app/devtools-app.component').then((m) => m.DevToolsComponent),
pathMatch: 'full',
},
{
path: 'demo-app',
loadChildren: () => import('./app/demo-app/demo-app.component').then((m) => m.ROUTES),
},
]),
{
provide: ApplicationOperations,
useClass: DemoApplicationOperations,
},
{
provide: ApplicationEnvironment,
useClass: DemoApplicationEnvironment,
},
]
});