-
Notifications
You must be signed in to change notification settings - Fork 6.8k
/
Copy pathmain.ts
37 lines (33 loc) · 1.42 KB
/
main.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/**
* @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.dev/license
*/
import {ErrorHandler} from '@angular/core';
import {provideHttpClient} from '@angular/common/http';
import {unregisterServiceWorkers} from './unregister-service-workers';
import {MaterialDocsApp} from './app/material-docs-app';
import {MATERIAL_DOCS_ROUTES} from './app/routes';
import {withInMemoryScrolling, provideRouter} from '@angular/router';
import {bootstrapApplication} from '@angular/platform-browser';
import {AnalyticsErrorReportHandler} from './app/shared/analytics/error-report-handler';
import {LocationStrategy, PathLocationStrategy} from '@angular/common';
// Unregister all installed service workers and force reload the page if there was
// an old service worker from a previous version of the docs.
unregisterServiceWorkers().then(hadServiceWorker => hadServiceWorker && location.reload());
bootstrapApplication(MaterialDocsApp, {
providers: [
{provide: LocationStrategy, useClass: PathLocationStrategy},
{provide: ErrorHandler, useClass: AnalyticsErrorReportHandler},
provideRouter(
MATERIAL_DOCS_ROUTES,
withInMemoryScrolling({
scrollPositionRestoration: 'enabled',
anchorScrolling: 'enabled',
}),
),
provideHttpClient(),
],
}).catch(err => console.error(err));