Skip to content

Commit e44e2c6

Browse files
authored
Reduce diff between dev and main branch (#36)
1 parent a9fc3ab commit e44e2c6

File tree

74 files changed

+380
-2094
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+380
-2094
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// Old AppComponent, before refactoring
2+
import { Component } from '@angular/core';
3+
import { RouterLink, RouterOutlet } from '@angular/router';
4+
5+
@Component({
6+
standalone: true,
7+
selector: 'app-root',
8+
template: '... the template ...',
9+
imports: [ RouterLink, RouterOutlet ]
10+
})
11+
export class AppComponent {
12+
title = 'Tour of Heroes';
13+
}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
// #region Dummy components to satisfy the router
2+
import { Component } from '@angular/core';
3+
4+
@Component({ standalone: true, selector: 'app-dashboard', template: '' })
5+
6+
class DashboardComponent {}
7+
@Component({ standalone: true, selector: 'app-dashboard', template: '' })
8+
class HeroDetailComponent {}
9+
10+
@Component({ standalone: true, selector: 'app-dashboard', template: '' })
11+
class HeroesComponent {}
12+
13+
// #endregion Dummy components to satisfy the router
14+
15+
// #docregion
16+
17+
import { bootstrapApplication } from '@angular/platform-browser';
18+
import { provideRouter, Routes} from '@angular/router';
19+
import { provideHttpClient } from '@angular/common/http';
20+
21+
import { AppComponent } from './app/app.component';
22+
23+
// ... more imports ...
24+
25+
export const routes: Routes = [
26+
{ path: '', redirectTo: '/dashboard', pathMatch: 'full' },
27+
{ path: 'dashboard', component: DashboardComponent },
28+
{ path: 'detail/:id', component: HeroDetailComponent },
29+
{ path: 'heroes', component: HeroesComponent }
30+
];
31+
32+
bootstrapApplication(AppComponent, {
33+
providers: [
34+
provideRouter(routes),
35+
provideHttpClient(),
36+
]
37+
}).catch(err => console.error(err));
38+
39+
// #enddocregion

aio/content/examples/ssr/readme.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Instructions for Angular SSR Example Download
2+
3+
This is the downloaded sample code for the [Angular SSR (Standalone) guide](https://angular.io/guide/ssr).
4+
5+
## Install and Run
6+
7+
1. `npm install` to install the `node_module` packages
8+
2. `ng serve` to launch the dev-server
9+
3. Launch the browser to `http://localhost:4200`
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { mergeApplicationConfig, ApplicationConfig } from '@angular/core';
2+
import { provideServerRendering } from '@angular/platform-server';
3+
import { appConfig } from './app.config';
4+
5+
const serverConfig: ApplicationConfig = {
6+
providers: [provideServerRendering()],
7+
};
8+
9+
export const config = mergeApplicationConfig(appConfig, serverConfig);
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
// #docplaster
2+
import {provideHttpClient, withFetch} from '@angular/common/http';
3+
import {ApplicationConfig, importProvidersFrom} from '@angular/core';
4+
import {provideClientHydration, provideProtractorTestingSupport} from '@angular/platform-browser';
5+
import {provideRouter} from '@angular/router';
6+
import {HttpClientInMemoryWebApiModule} from 'angular-in-memory-web-api';
7+
8+
import {routes} from './app.routes';
9+
import {InMemoryDataService} from './in-memory-data.service';
10+
11+
export const appConfig: ApplicationConfig = {
12+
providers: [
13+
provideRouter(routes),
14+
// TODO: Enable using Fetch API when disabling `HttpClientInMemoryWebApiModule`.
15+
provideHttpClient(/* withFetch()*/), provideClientHydration(),
16+
provideProtractorTestingSupport(), // essential for e2e testing
17+
18+
// TODO: Remove from production apps
19+
importProvidersFrom(
20+
// The HttpClientInMemoryWebApiModule module intercepts HTTP requests
21+
// and returns simulated server responses.
22+
// Remove it when a real server is ready to receive requests.
23+
HttpClientInMemoryWebApiModule.forRoot(InMemoryDataService, {dataEncapsulation: false})),
24+
// ...
25+
],
26+
};

aio/content/examples/universal-ngmodule/BUILD.bazel

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)