Skip to content

Commit df8a9e9

Browse files
committed
docs: update examples
1 parent 2fa62b7 commit df8a9e9

File tree

15 files changed

+32
-40
lines changed

15 files changed

+32
-40
lines changed
Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1-
import { ApplicationConfig } from '@angular/core';
1+
import {
2+
ApplicationConfig,
3+
provideZonelessChangeDetection,
4+
} from '@angular/core';
25

36
export const appConfig: ApplicationConfig = {
4-
providers: [],
7+
providers: [provideZonelessChangeDetection()],
58
};
Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,6 @@
11
import '@angular/compiler';
22
import { bootstrapApplication } from '@angular/platform-browser';
3-
import {
4-
mergeApplicationConfig,
5-
provideZonelessChangeDetection,
6-
} from '@angular/core';
73
import { App } from './app';
84
import { appConfig } from './app.config';
95

10-
const config = mergeApplicationConfig(appConfig, {
11-
providers: [provideZonelessChangeDetection()],
12-
});
13-
14-
bootstrapApplication(App, config);
6+
bootstrapApplication(App, appConfig);

projects/www/src/app/examples/store-walkthrough/src/app.config.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
1-
import { ApplicationConfig } from '@angular/core';
1+
import {
2+
ApplicationConfig,
3+
provideZonelessChangeDetection,
4+
} from '@angular/core';
5+
import { provideHttpClient } from '@angular/common/http';
26
import { provideStore } from '@ngrx/store';
37

48
import { booksReducer } from './state/books.reducer';
59
import { collectionReducer } from './state/collection.reducer';
610

711
export const appConfig: ApplicationConfig = {
812
providers: [
13+
provideZonelessChangeDetection(),
14+
provideHttpClient(),
915
provideStore({
1016
books: booksReducer,
1117
collection: collectionReducer,

projects/www/src/app/examples/store-walkthrough/src/app.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { Store } from '@ngrx/store';
33

44
import { selectBookCollection, selectBooks } from './state/books.selectors';
55
import { BooksActions, BooksApiActions } from './state/books.actions';
6-
import { GoogleBooks } from './book-list/books';
6+
import { GoogleBooksService } from './book-list/books-service';
77
import { BookList } from './book-list/book-list';
88
import { BookCollection } from './book-collection/book-collection';
99

@@ -24,7 +24,7 @@ import { BookCollection } from './book-collection/book-collection';
2424
imports: [BookList, BookCollection],
2525
})
2626
export class App implements OnInit {
27-
private readonly booksService = inject(GoogleBooks);
27+
private readonly booksService = inject(GoogleBooksService);
2828
private readonly store = inject(Store);
2929

3030
protected books = this.store.selectSignal(selectBooks);

projects/www/src/app/examples/store-walkthrough/src/book-collection/book-collection.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Component, EventEmitter, Input, Output } from '@angular/core';
2-
import { Book } from '../book-list/books.model';
2+
import { Book } from '../book-list/book';
33

44
@Component({
55
selector: 'app-book-collection',

projects/www/src/app/examples/store-walkthrough/src/book-list/book-list.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Component, EventEmitter, Input, Output } from '@angular/core';
2-
import { Book } from './books.model';
2+
import { Book } from './book';
33

44
@Component({
55
selector: 'app-book-list',
File renamed without changes.

projects/www/src/app/examples/store-walkthrough/src/book-list/books.ts renamed to projects/www/src/app/examples/store-walkthrough/src/book-list/books-service.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ import { HttpClient } from '@angular/common/http';
22
import { inject, Injectable } from '@angular/core';
33

44
import { Observable, map } from 'rxjs';
5-
import { Book } from './books.model';
5+
import { Book } from './book';
66

77
@Injectable({ providedIn: 'root' })
8-
export class GoogleBooks {
8+
export class GoogleBooksService {
99
private readonly http = inject(HttpClient);
1010

1111
getBooks(): Observable<Array<Book>> {
Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,6 @@
11
import '@angular/compiler';
22
import { bootstrapApplication } from '@angular/platform-browser';
3-
import {
4-
mergeApplicationConfig,
5-
provideZonelessChangeDetection,
6-
} from '@angular/core';
73
import { App } from './app';
84
import { appConfig } from './app.config';
9-
import { provideHttpClient } from '@angular/common/http';
105

11-
const config = mergeApplicationConfig(appConfig, {
12-
providers: [provideZonelessChangeDetection(), provideHttpClient()],
13-
});
14-
15-
bootstrapApplication(App, config);
6+
bootstrapApplication(App, appConfig);

projects/www/src/app/examples/store-walkthrough/src/state/app.state.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Book } from '../book-list/books.model';
1+
import { Book } from '../book-list/book';
22

33
export interface AppState {
44
books: ReadonlyArray<Book>;

0 commit comments

Comments
 (0)