Slide 1

Slide 1 text

Modern Apps

Slide 2

Slide 2 text

No content

Slide 3

Slide 3 text

- Winston Churchill

Slide 4

Slide 4 text

No content

Slide 5

Slide 5 text

No content

Slide 6

Slide 6 text

No content

Slide 7

Slide 7 text

No content

Slide 8

Slide 8 text

No content

Slide 9

Slide 9 text

No content

Slide 10

Slide 10 text

No content

Slide 11

Slide 11 text

No content

Slide 12

Slide 12 text

No content

Slide 13

Slide 13 text

No content

Slide 14

Slide 14 text

Fabian Gosebrink https://offering.solutions Google Developer Expert Microsoft MVP Pluralsight Author

Slide 15

Slide 15 text

No content

Slide 16

Slide 16 text

No content

Slide 17

Slide 17 text

main.ts app.module.ts app.component.ts

Slide 18

Slide 18 text

main.ts app.module.ts app.component.ts

Slide 19

Slide 19 text

platformBrowserDynamic() .bootstrapModule(AppModule) .catch((err) => console.error(err)); 1 2 3

Slide 20

Slide 20 text

import { NgModule } from '@angular/...'; import { BrowserModule } from '@angular/...'; import { AppComponent } from './app.component'; @NgModule({ declarations: [AppComponent], imports: [BrowserModule], providers: [], bootstrap: [AppComponent], }) export class AppModule {} 1 2 3 4 5 6 7 8 9 10 11

Slide 21

Slide 21 text

import { Component } from '@angular/core'; @Component({ selector: 'app-root', template: `{{ title }}`, styleUrls: ['./app.component.css'], }) export class AppComponent { title = 'oldangularapp'; } 1 2 3 4 5 6 7 8 9 10

Slide 22

Slide 22 text

import { bootstrapApplication } from '@angular/platform-browser'; import { ImageGridComponent } from'./image-grid'; @Component({ standalone: true, selector: 'photo-gallery', imports: [ImageGridComponent], template: ` `, }) export class PhotoGalleryComponent { // component logic } bootstrapApplication(PhotoGalleryComponent); 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16

Slide 23

Slide 23 text

import { bootstrapApplication } from '@angular/platform-browser'; import { ImageGridComponent } from'./image-grid'; @Component({ standalone: true, selector: 'photo-gallery', imports: [ImageGridComponent], template: ` `, }) export class PhotoGalleryComponent { // component logic } bootstrapApplication(PhotoGalleryComponent); 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 standalone: true, import { bootstrapApplication } from '@angular/platform-browser'; 1 import { ImageGridComponent } from'./image-grid'; 2 3 @Component({ 4 5 selector: 'photo-gallery', 6 imports: [ImageGridComponent], 7 template: ` 8 9 `, 10 }) 11 export class PhotoGalleryComponent { 12 // component logic 13 } 14 15 bootstrapApplication(PhotoGalleryComponent); 16

Slide 24

Slide 24 text

import { bootstrapApplication } from '@angular/platform-browser'; import { ImageGridComponent } from'./image-grid'; @Component({ standalone: true, selector: 'photo-gallery', imports: [ImageGridComponent], template: ` `, }) export class PhotoGalleryComponent { // component logic } bootstrapApplication(PhotoGalleryComponent); 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 standalone: true, import { bootstrapApplication } from '@angular/platform-browser'; 1 import { ImageGridComponent } from'./image-grid'; 2 3 @Component({ 4 5 selector: 'photo-gallery', 6 imports: [ImageGridComponent], 7 template: ` 8 9 `, 10 }) 11 export class PhotoGalleryComponent { 12 // component logic 13 } 14 15 bootstrapApplication(PhotoGalleryComponent); 16 imports: [ImageGridComponent], import { bootstrapApplication } from '@angular/platform-browser'; 1 import { ImageGridComponent } from'./image-grid'; 2 3 @Component({ 4 standalone: true, 5 selector: 'photo-gallery', 6 7 template: ` 8 9 `, 10 }) 11 export class PhotoGalleryComponent { 12 // component logic 13 } 14 15 bootstrapApplication(PhotoGalleryComponent); 16

Slide 25

Slide 25 text

import { bootstrapApplication } from '@angular/platform-browser'; import { ImageGridComponent } from'./image-grid'; @Component({ standalone: true, selector: 'photo-gallery', imports: [ImageGridComponent], template: ` `, }) export class PhotoGalleryComponent { // component logic } bootstrapApplication(PhotoGalleryComponent); 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 standalone: true, import { bootstrapApplication } from '@angular/platform-browser'; 1 import { ImageGridComponent } from'./image-grid'; 2 3 @Component({ 4 5 selector: 'photo-gallery', 6 imports: [ImageGridComponent], 7 template: ` 8 9 `, 10 }) 11 export class PhotoGalleryComponent { 12 // component logic 13 } 14 15 bootstrapApplication(PhotoGalleryComponent); 16 imports: [ImageGridComponent], import { bootstrapApplication } from '@angular/platform-browser'; 1 import { ImageGridComponent } from'./image-grid'; 2 3 @Component({ 4 standalone: true, 5 selector: 'photo-gallery', 6 7 template: ` 8 9 `, 10 }) 11 export class PhotoGalleryComponent { 12 // component logic 13 } 14 15 bootstrapApplication(PhotoGalleryComponent); 16 export class PhotoGalleryComponent { // component logic } import { bootstrapApplication } from '@angular/platform-browser'; 1 import { ImageGridComponent } from'./image-grid'; 2 3 @Component({ 4 standalone: true, 5 selector: 'photo-gallery', 6 imports: [ImageGridComponent], 7 template: ` 8 9 `, 10 }) 11 12 13 14 15 bootstrapApplication(PhotoGalleryComponent); 16

Slide 26

Slide 26 text

import { bootstrapApplication } from '@angular/platform-browser'; import { ImageGridComponent } from'./image-grid'; @Component({ standalone: true, selector: 'photo-gallery', imports: [ImageGridComponent], template: ` `, }) export class PhotoGalleryComponent { // component logic } bootstrapApplication(PhotoGalleryComponent); 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 standalone: true, import { bootstrapApplication } from '@angular/platform-browser'; 1 import { ImageGridComponent } from'./image-grid'; 2 3 @Component({ 4 5 selector: 'photo-gallery', 6 imports: [ImageGridComponent], 7 template: ` 8 9 `, 10 }) 11 export class PhotoGalleryComponent { 12 // component logic 13 } 14 15 bootstrapApplication(PhotoGalleryComponent); 16 imports: [ImageGridComponent], import { bootstrapApplication } from '@angular/platform-browser'; 1 import { ImageGridComponent } from'./image-grid'; 2 3 @Component({ 4 standalone: true, 5 selector: 'photo-gallery', 6 7 template: ` 8 9 `, 10 }) 11 export class PhotoGalleryComponent { 12 // component logic 13 } 14 15 bootstrapApplication(PhotoGalleryComponent); 16 export class PhotoGalleryComponent { // component logic } import { bootstrapApplication } from '@angular/platform-browser'; 1 import { ImageGridComponent } from'./image-grid'; 2 3 @Component({ 4 standalone: true, 5 selector: 'photo-gallery', 6 imports: [ImageGridComponent], 7 template: ` 8 9 `, 10 }) 11 12 13 14 15 bootstrapApplication(PhotoGalleryComponent); 16 bootstrapApplication(PhotoGalleryComponent); import { bootstrapApplication } from '@angular/platform-browser'; 1 import { ImageGridComponent } from'./image-grid'; 2 3 @Component({ 4 standalone: true, 5 selector: 'photo-gallery', 6 imports: [ImageGridComponent], 7 template: ` 8 9 `, 10 }) 11 export class PhotoGalleryComponent { 12 // component logic 13 } 14 15 16

Slide 27

Slide 27 text

No content

Slide 28

Slide 28 text

No content

Slide 29

Slide 29 text

No content

Slide 30

Slide 30 text

No content

Slide 31

Slide 31 text

No content

Slide 32

Slide 32 text

No content

Slide 33

Slide 33 text

No content

Slide 34

Slide 34 text

No content

Slide 35

Slide 35 text

ng generate @angular/core:standalone

Slide 36

Slide 36 text

Convert all components, directives, and pipes to standalone Remove unnecessary NgModule classes Bootstrap the application using standalone APIs

Slide 37

Slide 37 text

No content

Slide 38

Slide 38 text

export const appConfig: ApplicationConfig = { providers: [ // ... importProvidersFrom( ToastrModule.forRoot({ /* ... */ }), BrowserAnimationsModule ), ], }; 1 2 3 4 5 6 7 8 9

Slide 39

Slide 39 text

export const appConfig: ApplicationConfig = { providers: [ // ... importProvidersFrom( ToastrModule.forRoot({ /* ... */ }), BrowserAnimationsModule ), ], }; 1 2 3 4 5 6 7 8 9 importProvidersFrom( ToastrModule.forRoot({ /* ... */ }), BrowserAnimationsModule ), export const appConfig: ApplicationConfig = { 1 providers: [ 2 // ... 3 4 5 6 7 ], 8 }; 9

Slide 40

Slide 40 text

export const appConfig: ApplicationConfig = { providers: [ // ... provideRouter(APP_ROUTES), provideHttpClient( withInterceptors([...]), ), importProvidersFrom( ToastrModule.forRoot({ /* ... */ }), BrowserAnimationsModule ), ], }; 1 2 3 4 5 6 7 8 9 10 11 12 13 14

Slide 41

Slide 41 text

export const appConfig: ApplicationConfig = { providers: [ // ... provideRouter(APP_ROUTES), provideHttpClient( withInterceptors([...]), ), importProvidersFrom( ToastrModule.forRoot({ /* ... */ }), BrowserAnimationsModule ), ], }; 1 2 3 4 5 6 7 8 9 10 11 12 13 14 provideRouter(APP_ROUTES), provideHttpClient( withInterceptors([...]), ), export const appConfig: ApplicationConfig = { 1 providers: [ 2 // ... 3 4 5 6 7 8 importProvidersFrom( 9 ToastrModule.forRoot({ /* ... */ }), 10 BrowserAnimationsModule 11 ), 12 ], 13 }; 14

Slide 42

Slide 42 text

provideRouter(APP_ROUTES), provideHttpClient( withInterceptors([...]), withFetch() ), export const appConfig: ApplicationConfig = { 1 providers: [ 2 // ... 3 4 5 6 7 8 importProvidersFrom( 9 ToastrModule.forRoot({ /* ... */ }), 10 BrowserAnimationsModule 11 ), 12 ], 13 }; 14

Slide 43

Slide 43 text

provideAuth({ /* ... */ }), export const appConfig: ApplicationConfig = { 1 providers: [ 2 // ... 3 provideRouter(APP_ROUTES), 4 provideHttpClient( 5 withInterceptors([...]), 6 withFetch() 7 ), 8 9 importProvidersFrom( 10 ToastrModule.forRoot({ /* ... */ }), 11 BrowserAnimationsModule 12 ), 13 ], 14 }; 15

Slide 44

Slide 44 text

No content

Slide 45

Slide 45 text

No content

Slide 46

Slide 46 text

@Injectable() export class MyInterceptor implements HttpInterceptor { constructor(private authService: AuthService){} intercept(request: HttpRequest>, next: HttpHandler): Observable { const accessToken = this.authService.getToken(); const clonedRequest = req.clone({ headers: req.headers.set('Authorization', `Bearer ${accessToken}`), }); return next.handle(clonedRequest); } } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15

Slide 47

Slide 47 text

export function myInterceptor(req: HttpRequest, next: HttpHandlerFn) { const loadingService = inject(AuthService); const accessToken = this.authService.getToken(); const clonedRequest = req.clone({ headers: req.headers.set('Authorization', `Bearer ${accessToken}`), }); return next(clonedRequest); } 1 2 3 4 5 6 7 8 9 10

Slide 48

Slide 48 text

providers: [ { provide: HTTP_INTERCEPTORS, useClass: AuthInterceptor, multi: true }, ], 1 2 3

Slide 49

Slide 49 text

providers: [ { provide: HTTP_INTERCEPTORS, useClass: AuthInterceptor, multi: true }, ], 1 2 3 providers: [ provideHttpClient(withInterceptors([authInterceptor()])), ], 1 2 3

Slide 50

Slide 50 text

@Injectable({ providedIn: 'root' }) export class AuthorizationGuard implements CanActivate { constructor( private oidcSecurityService: OidcSecurityService, private router: Router ) {} canActivate( route: ActivatedRouteSnapshot, state: RouterStateSnapshot ): Observable { return this.oidcSecurityService.isAuthenticated$.pipe( map(({ isAuthenticated }) => { // allow navigation if authenticated if (isAuthenticated) { return true; } // redirect if not authenticated return this.router.parseUrl(''); }) ); } } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24

Slide 51

Slide 51 text

export const authenticatedGuard = () => { const router = inject(Router); const securityService = inject(OidcSecurityService); return securityService.isAuthenticated$.pipe( map(({ isAuthenticated }) => { // allow navigation if authenticated if (isAuthenticated) { return true; } // redirect if not authenticated return router.parseUrl(''); }) ); }; 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16

Slide 52

Slide 52 text

export const DOGGOS_ROUTES: Routes = [ { path: 'my', component: MyDoggosComponent, canActivate: [isAuthenticated], }, { path: 'my/add', component: AddDoggoComponent, canActivate: [isAuthenticated], }, ]; 1 2 3 4 5 6 7 8 9 10 11 12

Slide 53

Slide 53 text

export const DOGGOS_ROUTES: Routes = [ { path: 'my', component: MyDoggosComponent, canActivate: [isAuthenticated], }, { path: 'my/add', component: AddDoggoComponent, canActivate: [isAuthenticated], }, ]; 1 2 3 4 5 6 7 8 9 10 11 12 canActivate: [isAuthenticated], canActivate: [isAuthenticated], export const DOGGOS_ROUTES: Routes = [ 1 { 2 path: 'my', 3 component: MyDoggosComponent, 4 5 }, 6 { 7 path: 'my/add', 8 component: AddDoggoComponent, 9 10 }, 11 ]; 12

Slide 54

Slide 54 text

No content

Slide 55

Slide 55 text

No content

Slide 56

Slide 56 text

@Component({ selector: 'my-app', standalone: true, template: ` {{ fullName() }} Click `, }) export class App { firstName = signal('Jane'); lastName = signal('Doe'); fullName = computed(() => `${this.firstName()} ${this.lastName()}`); constructor() { effect(() => console.log('Name changed:', this.fullName())); } setName(newName: string) { this.firstName.set(newName); } } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21

Slide 57

Slide 57 text

@Component({ selector: 'my-app', standalone: true, template: ` {{ fullName() }} Click `, }) export class App { firstName = signal('Jane'); lastName = signal('Doe'); fullName = computed(() => `${this.firstName()} ${this.lastName()}`); constructor() { effect(() => console.log('Name changed:', this.fullName())); } setName(newName: string) { this.firstName.set(newName); } } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 firstName = signal('Jane'); lastName = signal('Doe'); @Component({ 1 selector: 'my-app', 2 standalone: true, 3 template: ` 4 {{ fullName() }} 5 Click 6 `, 7 }) 8 export class App { 9 10 11 fullName = computed(() => `${this.firstName()} ${this.lastName()}`); 12 13 constructor() { 14 effect(() => console.log('Name changed:', this.fullName())); 15 } 16 17 setName(newName: string) { 18 this.firstName.set(newName); 19 } 20 } 21

Slide 58

Slide 58 text

@Component({ selector: 'my-app', standalone: true, template: ` {{ fullName() }} Click `, }) export class App { firstName = signal('Jane'); lastName = signal('Doe'); fullName = computed(() => `${this.firstName()} ${this.lastName()}`); constructor() { effect(() => console.log('Name changed:', this.fullName())); } setName(newName: string) { this.firstName.set(newName); } } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 firstName = signal('Jane'); lastName = signal('Doe'); @Component({ 1 selector: 'my-app', 2 standalone: true, 3 template: ` 4 {{ fullName() }} 5 Click 6 `, 7 }) 8 export class App { 9 10 11 fullName = computed(() => `${this.firstName()} ${this.lastName()}`); 12 13 constructor() { 14 effect(() => console.log('Name changed:', this.fullName())); 15 } 16 17 setName(newName: string) { 18 this.firstName.set(newName); 19 } 20 } 21 fullName = computed(() => `${this.firstName()} ${this.lastName()}`); @Component({ 1 selector: 'my-app', 2 standalone: true, 3 template: ` 4 {{ fullName() }} 5 Click 6 `, 7 }) 8 export class App { 9 firstName = signal('Jane'); 10 lastName = signal('Doe'); 11 12 13 constructor() { 14 effect(() => console.log('Name changed:', this.fullName())); 15 } 16 17 setName(newName: string) { 18 this.firstName.set(newName); 19 } 20 } 21

Slide 59

Slide 59 text

@Component({ selector: 'my-app', standalone: true, template: ` {{ fullName() }} Click `, }) export class App { firstName = signal('Jane'); lastName = signal('Doe'); fullName = computed(() => `${this.firstName()} ${this.lastName()}`); constructor() { effect(() => console.log('Name changed:', this.fullName())); } setName(newName: string) { this.firstName.set(newName); } } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 firstName = signal('Jane'); lastName = signal('Doe'); @Component({ 1 selector: 'my-app', 2 standalone: true, 3 template: ` 4 {{ fullName() }} 5 Click 6 `, 7 }) 8 export class App { 9 10 11 fullName = computed(() => `${this.firstName()} ${this.lastName()}`); 12 13 constructor() { 14 effect(() => console.log('Name changed:', this.fullName())); 15 } 16 17 setName(newName: string) { 18 this.firstName.set(newName); 19 } 20 } 21 fullName = computed(() => `${this.firstName()} ${this.lastName()}`); @Component({ 1 selector: 'my-app', 2 standalone: true, 3 template: ` 4 {{ fullName() }} 5 Click 6 `, 7 }) 8 export class App { 9 firstName = signal('Jane'); 10 lastName = signal('Doe'); 11 12 13 constructor() { 14 effect(() => console.log('Name changed:', this.fullName())); 15 } 16 17 setName(newName: string) { 18 this.firstName.set(newName); 19 } 20 } 21 {{ fullName() }} fullName = computed(() => `${this.firstName()} ${this.lastName()}`); @Component({ 1 selector: 'my-app', 2 standalone: true, 3 template: ` 4 5 Click 6 `, 7 }) 8 export class App { 9 firstName = signal('Jane'); 10 lastName = signal('Doe'); 11 12 13 constructor() { 14 effect(() => console.log('Name changed:', this.fullName())); 15 } 16 17 setName(newName: string) { 18 this.firstName.set(newName); 19 } 20 } 21

Slide 60

Slide 60 text

@Component({ selector: 'my-app', standalone: true, template: ` {{ fullName() }} Click `, }) export class App { firstName = signal('Jane'); lastName = signal('Doe'); fullName = computed(() => `${this.firstName()} ${this.lastName()}`); constructor() { effect(() => console.log('Name changed:', this.fullName())); } setName(newName: string) { this.firstName.set(newName); } } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 firstName = signal('Jane'); lastName = signal('Doe'); @Component({ 1 selector: 'my-app', 2 standalone: true, 3 template: ` 4 {{ fullName() }} 5 Click 6 `, 7 }) 8 export class App { 9 10 11 fullName = computed(() => `${this.firstName()} ${this.lastName()}`); 12 13 constructor() { 14 effect(() => console.log('Name changed:', this.fullName())); 15 } 16 17 setName(newName: string) { 18 this.firstName.set(newName); 19 } 20 } 21 fullName = computed(() => `${this.firstName()} ${this.lastName()}`); @Component({ 1 selector: 'my-app', 2 standalone: true, 3 template: ` 4 {{ fullName() }} 5 Click 6 `, 7 }) 8 export class App { 9 firstName = signal('Jane'); 10 lastName = signal('Doe'); 11 12 13 constructor() { 14 effect(() => console.log('Name changed:', this.fullName())); 15 } 16 17 setName(newName: string) { 18 this.firstName.set(newName); 19 } 20 } 21 {{ fullName() }} fullName = computed(() => `${this.firstName()} ${this.lastName()}`); @Component({ 1 selector: 'my-app', 2 standalone: true, 3 template: ` 4 5 Click 6 `, 7 }) 8 export class App { 9 firstName = signal('Jane'); 10 lastName = signal('Doe'); 11 12 13 constructor() { 14 effect(() => console.log('Name changed:', this.fullName())); 15 } 16 17 setName(newName: string) { 18 this.firstName.set(newName); 19 } 20 } 21 effect(() => console.log('Name changed:', this.fullName())); @Component({ 1 selector: 'my-app', 2 standalone: true, 3 template: ` 4 {{ fullName() }} 5 Click 6 `, 7 }) 8 export class App { 9 firstName = signal('Jane'); 10 lastName = signal('Doe'); 11 fullName = computed(() => `${this.firstName()} ${this.lastName()}`); 12 13 constructor() { 14 15 } 16 17 setName(newName: string) { 18 this.firstName.set(newName); 19 } 20 } 21

Slide 61

Slide 61 text

@Component({ selector: 'my-app', standalone: true, template: ` {{ fullName() }} Click `, }) export class App { firstName = signal('Jane'); lastName = signal('Doe'); fullName = computed(() => `${this.firstName()} ${this.lastName()}`); constructor() { effect(() => console.log('Name changed:', this.fullName())); } setName(newName: string) { this.firstName.set(newName); } } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 firstName = signal('Jane'); lastName = signal('Doe'); @Component({ 1 selector: 'my-app', 2 standalone: true, 3 template: ` 4 {{ fullName() }} 5 Click 6 `, 7 }) 8 export class App { 9 10 11 fullName = computed(() => `${this.firstName()} ${this.lastName()}`); 12 13 constructor() { 14 effect(() => console.log('Name changed:', this.fullName())); 15 } 16 17 setName(newName: string) { 18 this.firstName.set(newName); 19 } 20 } 21 fullName = computed(() => `${this.firstName()} ${this.lastName()}`); @Component({ 1 selector: 'my-app', 2 standalone: true, 3 template: ` 4 {{ fullName() }} 5 Click 6 `, 7 }) 8 export class App { 9 firstName = signal('Jane'); 10 lastName = signal('Doe'); 11 12 13 constructor() { 14 effect(() => console.log('Name changed:', this.fullName())); 15 } 16 17 setName(newName: string) { 18 this.firstName.set(newName); 19 } 20 } 21 {{ fullName() }} fullName = computed(() => `${this.firstName()} ${this.lastName()}`); @Component({ 1 selector: 'my-app', 2 standalone: true, 3 template: ` 4 5 Click 6 `, 7 }) 8 export class App { 9 firstName = signal('Jane'); 10 lastName = signal('Doe'); 11 12 13 constructor() { 14 effect(() => console.log('Name changed:', this.fullName())); 15 } 16 17 setName(newName: string) { 18 this.firstName.set(newName); 19 } 20 } 21 effect(() => console.log('Name changed:', this.fullName())); @Component({ 1 selector: 'my-app', 2 standalone: true, 3 template: ` 4 {{ fullName() }} 5 Click 6 `, 7 }) 8 export class App { 9 firstName = signal('Jane'); 10 lastName = signal('Doe'); 11 fullName = computed(() => `${this.firstName()} ${this.lastName()}`); 12 13 constructor() { 14 15 } 16 17 setName(newName: string) { 18 this.firstName.set(newName); 19 } 20 } 21 this.firstName.set(newName); @Component({ 1 selector: 'my-app', 2 standalone: true, 3 template: ` 4 {{ fullName() }} 5 Click 6 `, 7 }) 8 export class App { 9 firstName = signal('Jane'); 10 lastName = signal('Doe'); 11 fullName = computed(() => `${this.firstName()} ${this.lastName()}`); 12 13 constructor() { 14 effect(() => console.log('Name changed:', this.fullName())); 15 } 16 17 setName(newName: string) { 18 19 } 20 } 21

Slide 62

Slide 62 text

@Component({ selector: 'my-app', standalone: true, template: ` {{ fullName() }} Click `, }) export class App { firstName = signal('Jane'); lastName = signal('Doe'); fullName = computed(() => `${this.firstName()} ${this.lastName()}`); constructor() { effect(() => console.log('Name changed:', this.fullName())); } setName(newName: string) { this.firstName.set(newName); } } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 firstName = signal('Jane'); lastName = signal('Doe'); @Component({ 1 selector: 'my-app', 2 standalone: true, 3 template: ` 4 {{ fullName() }} 5 Click 6 `, 7 }) 8 export class App { 9 10 11 fullName = computed(() => `${this.firstName()} ${this.lastName()}`); 12 13 constructor() { 14 effect(() => console.log('Name changed:', this.fullName())); 15 } 16 17 setName(newName: string) { 18 this.firstName.set(newName); 19 } 20 } 21 fullName = computed(() => `${this.firstName()} ${this.lastName()}`); @Component({ 1 selector: 'my-app', 2 standalone: true, 3 template: ` 4 {{ fullName() }} 5 Click 6 `, 7 }) 8 export class App { 9 firstName = signal('Jane'); 10 lastName = signal('Doe'); 11 12 13 constructor() { 14 effect(() => console.log('Name changed:', this.fullName())); 15 } 16 17 setName(newName: string) { 18 this.firstName.set(newName); 19 } 20 } 21 {{ fullName() }} fullName = computed(() => `${this.firstName()} ${this.lastName()}`); @Component({ 1 selector: 'my-app', 2 standalone: true, 3 template: ` 4 5 Click 6 `, 7 }) 8 export class App { 9 firstName = signal('Jane'); 10 lastName = signal('Doe'); 11 12 13 constructor() { 14 effect(() => console.log('Name changed:', this.fullName())); 15 } 16 17 setName(newName: string) { 18 this.firstName.set(newName); 19 } 20 } 21 effect(() => console.log('Name changed:', this.fullName())); @Component({ 1 selector: 'my-app', 2 standalone: true, 3 template: ` 4 {{ fullName() }} 5 Click 6 `, 7 }) 8 export class App { 9 firstName = signal('Jane'); 10 lastName = signal('Doe'); 11 fullName = computed(() => `${this.firstName()} ${this.lastName()}`); 12 13 constructor() { 14 15 } 16 17 setName(newName: string) { 18 this.firstName.set(newName); 19 } 20 } 21 this.firstName.set(newName); @Component({ 1 selector: 'my-app', 2 standalone: true, 3 template: ` 4 {{ fullName() }} 5 Click 6 `, 7 }) 8 export class App { 9 firstName = signal('Jane'); 10 lastName = signal('Doe'); 11 fullName = computed(() => `${this.firstName()} ${this.lastName()}`); 12 13 constructor() { 14 effect(() => console.log('Name changed:', this.fullName())); 15 } 16 17 setName(newName: string) { 18 19 } 20 } 21 firstName = signal('Jane'); this.firstName.set(newName); @Component({ 1 selector: 'my-app', 2 standalone: true, 3 template: ` 4 {{ fullName() }} 5 Click 6 `, 7 }) 8 export class App { 9 10 lastName = signal('Doe'); 11 fullName = computed(() => `${this.firstName()} ${this.lastName()}`); 12 13 constructor() { 14 effect(() => console.log('Name changed:', this.fullName())); 15 } 16 17 setName(newName: string) { 18 19 } 20 } 21

Slide 63

Slide 63 text

@Component({ selector: 'my-app', standalone: true, template: ` {{ fullName() }} Click `, }) export class App { firstName = signal('Jane'); lastName = signal('Doe'); fullName = computed(() => `${this.firstName()} ${this.lastName()}`); constructor() { effect(() => console.log('Name changed:', this.fullName())); } setName(newName: string) { this.firstName.set(newName); } } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 firstName = signal('Jane'); lastName = signal('Doe'); @Component({ 1 selector: 'my-app', 2 standalone: true, 3 template: ` 4 {{ fullName() }} 5 Click 6 `, 7 }) 8 export class App { 9 10 11 fullName = computed(() => `${this.firstName()} ${this.lastName()}`); 12 13 constructor() { 14 effect(() => console.log('Name changed:', this.fullName())); 15 } 16 17 setName(newName: string) { 18 this.firstName.set(newName); 19 } 20 } 21 fullName = computed(() => `${this.firstName()} ${this.lastName()}`); @Component({ 1 selector: 'my-app', 2 standalone: true, 3 template: ` 4 {{ fullName() }} 5 Click 6 `, 7 }) 8 export class App { 9 firstName = signal('Jane'); 10 lastName = signal('Doe'); 11 12 13 constructor() { 14 effect(() => console.log('Name changed:', this.fullName())); 15 } 16 17 setName(newName: string) { 18 this.firstName.set(newName); 19 } 20 } 21 {{ fullName() }} fullName = computed(() => `${this.firstName()} ${this.lastName()}`); @Component({ 1 selector: 'my-app', 2 standalone: true, 3 template: ` 4 5 Click 6 `, 7 }) 8 export class App { 9 firstName = signal('Jane'); 10 lastName = signal('Doe'); 11 12 13 constructor() { 14 effect(() => console.log('Name changed:', this.fullName())); 15 } 16 17 setName(newName: string) { 18 this.firstName.set(newName); 19 } 20 } 21 effect(() => console.log('Name changed:', this.fullName())); @Component({ 1 selector: 'my-app', 2 standalone: true, 3 template: ` 4 {{ fullName() }} 5 Click 6 `, 7 }) 8 export class App { 9 firstName = signal('Jane'); 10 lastName = signal('Doe'); 11 fullName = computed(() => `${this.firstName()} ${this.lastName()}`); 12 13 constructor() { 14 15 } 16 17 setName(newName: string) { 18 this.firstName.set(newName); 19 } 20 } 21 this.firstName.set(newName); @Component({ 1 selector: 'my-app', 2 standalone: true, 3 template: ` 4 {{ fullName() }} 5 Click 6 `, 7 }) 8 export class App { 9 firstName = signal('Jane'); 10 lastName = signal('Doe'); 11 fullName = computed(() => `${this.firstName()} ${this.lastName()}`); 12 13 constructor() { 14 effect(() => console.log('Name changed:', this.fullName())); 15 } 16 17 setName(newName: string) { 18 19 } 20 } 21 firstName = signal('Jane'); this.firstName.set(newName); @Component({ 1 selector: 'my-app', 2 standalone: true, 3 template: ` 4 {{ fullName() }} 5 Click 6 `, 7 }) 8 export class App { 9 10 lastName = signal('Doe'); 11 fullName = computed(() => `${this.firstName()} ${this.lastName()}`); 12 13 constructor() { 14 effect(() => console.log('Name changed:', this.fullName())); 15 } 16 17 setName(newName: string) { 18 19 } 20 } 21 effect(() => console.log('Name changed:', this.fullName())); @Component({ 1 selector: 'my-app', 2 standalone: true, 3 template: ` 4 {{ fullName() }} 5 Click 6 `, 7 }) 8 export class App { 9 firstName = signal('Jane'); 10 lastName = signal('Doe'); 11 fullName = computed(() => `${this.firstName()} ${this.lastName()}`); 12 13 constructor() { 14 15 } 16 17 setName(newName: string) { 18 this.firstName.set(newName); 19 } 20 } 21

Slide 64

Slide 64 text

import { toObservable } from '@angular/core/rxjs-interop'; @Component({...}) export class App { count = signal(0); count$ = toObservable(this.count); ngOnInit() { this.count$.subscribe(() => ...); } } 1 2 3 4 5 6 7 8 9 10 11

Slide 65

Slide 65 text

import { toSignal } from '@angular/core/rxjs-interop'; @Component({ template: `
  • {{ row }}
  • ` }) export class App { dataService = inject(DataService); data = toSignal(this.dataService.data$, []); } 1 2 3 4 5 6 7 8 9 10 11 12

    Slide 66

    Slide 66 text

    No content

    Slide 67

    Slide 67 text

    No content

    Slide 68

    Slide 68 text

    Jest in Angular CLI { "projects": { "my-app": { "architect": { "test": { "builder": "@angular-devkit/build-angular:jest", "options": { "tsConfig": "tsconfig.spec.json", "polyfills": ["zone.js", "zone.js/testing"] } } } } } } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15

    Slide 69

    Slide 69 text

    Autocomplete imports in templates

    Slide 70

    Slide 70 text

    Required Inputs @Component(...) export class App { @Input({ required: true }) title: string = ''; } 1 2 3 4

    Slide 71

    Slide 71 text

    Injectable Destroy import { Injectable, DestroyRef } from '@angular/core'; @Injectable(...) export class AppService { destroyRef = inject(DestroyRef); destroy() { this.destroyRef.onDestroy(() => /* cleanup */ ); } } 1 2 3 4 5 6 7 8 9 10

    Slide 72

    Slide 72 text

    Self Closing Tags 1

    Slide 73

    Slide 73 text

    New Template Syntax trackByFunction(index, item) { return item.id; }
    Item #{{ idx }}: {{ item.name }}
    1 2 3 4 5 6 7

    Slide 74

    Slide 74 text

    New Template Syntax trackByFunction(index, item) { return item.id; }
    Item #{{ idx }}: {{ item.name }}
    1 2 3 4 5 6 7 {#for item of items; track item.id; let idx = $index, e = $even} Item #{{ idx }}: {{ item.name }} {/for} 1 2 3

    Slide 75

    Slide 75 text

    New Template Syntax {#for item of items; track item.id} {{ item }} {:empty} There were no items in the list. {/for} 1 2 3 4 5

    Slide 76

    Slide 76 text

    New Template Syntax Main case was true! Extra case was true! False case! 1 2 3 4 5 6 7 8 9 10 11 12 13

    Slide 77

    Slide 77 text

    New Template Syntax {#if cond.expr} Main case was true! {:else if other.expr} Extra case was true! {:else} False case! {/if} 1 2 3 4 5 6 7

    Slide 78

    Slide 78 text

    No content

    Slide 79

    Slide 79 text

    No content

    Slide 80

    Slide 80 text

    No content

    Slide 81

    Slide 81 text

    @Component({ selector: 'app-my-doggos', standalone: true, templateUrl: './my-doggos.component.html', styleUrls: ['./my-doggos.component.css'], imports: [AsyncPipe, RouterLink, DatePipe, DecimalPipe, NgFor], }) export class MyDoggosComponent implements OnInit { private readonly store = inject(Store); doggos = this.store.select(getMyDoggos); ngOnInit(): void { this.store.dispatch(DoggosActions.loadMyDoggos()); } deleteDoggo(doggo: Doggo) { this.store.dispatch(DoggosActions.deleteDoggo({ doggo })); } } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20

    Slide 82

    Slide 82 text

    Component Store State Reducer Effects Actions

    Slide 83

    Slide 83 text

    No content

    Slide 84

    Slide 84 text

    No content

    Slide 85

    Slide 85 text

    No content

    Slide 86

    Slide 86 text

    No content

    Slide 87

    Slide 87 text

    No content

    Slide 88

    Slide 88 text

    No content

    Slide 89

    Slide 89 text

    No content

    Slide 90

    Slide 90 text

    Share code between apps

    Slide 91

    Slide 91 text

    Share code between apps Provide feature to one app

    Slide 92

    Slide 92 text

    Share code between apps Provide feature to one app Multiple Libs = 1 Feature

    Slide 93

    Slide 93 text

    Feature Ui Feature Domain Utils Util- Environments Util-Auth UI-Common Util-Common About Doggos App Shared

    Slide 94

    Slide 94 text

    type:app, scope:doggo-rating-app

    Slide 95

    Slide 95 text

    type:feature scope:about type:app, scope:doggo-rating-app

    Slide 96

    Slide 96 text

    type:feature type:ui type:feature type:domain type:utils scope:about scope:doggos type:app, scope:doggo-rating-app

    Slide 97

    Slide 97 text

    type:feature type:ui type:feature type:domain type:utils scope:about scope:doggos type:app, scope:doggo-rating-app scope:shared type:util type:util type:ui type:util

    Slide 98

    Slide 98 text

    No content

    Slide 99

    Slide 99 text

    { "name": "about-feature", "$schema": "../node_modules/nx/schemas/project-schema.json", "projectType": "library", "sourceRoot": "libs/about/feature/src", "prefix": "ps-doggo-rating", "targets": { // ... }, "tags": ["type:feature", "scope:about"] } 1 2 3 4 5 6 7 8 9 10 11

    Slide 100

    Slide 100 text

    { "name": "about-feature", "$schema": "../node_modules/nx/schemas/project-schema.json", "projectType": "library", "sourceRoot": "libs/about/feature/src", "prefix": "ps-doggo-rating", "targets": { // ... }, "tags": ["type:feature", "scope:about"] } 1 2 3 4 5 6 7 8 9 10 11 "tags": ["type:feature", "scope:about"] { 1 "name": "about-feature", 2 "$schema": "../node_modules/nx/schemas/project-schema.json", 3 "projectType": "library", 4 "sourceRoot": "libs/about/feature/src", 5 "prefix": "ps-doggo-rating", 6 "targets": { 7 // ... 8 }, 9 10 } 11

    Slide 101

    Slide 101 text

    "@nx/enforce-module-boundaries": [ "error", { "enforceBuildableLibDependency": true, "allow": [], "depConstraints": [ { "sourceTag": "scope:doggo-rating-app", "onlyDependOnLibsWithTags": [ "scope:doggos", "scope:about", "scope:shared" ] }, { "sourceTag": "scope:about", "onlyDependOnLibsWithTags": ["scope:about", "scope:shared"] }, { "sourceTag": "scope:doggos", "onlyDependOnLibsWithTags": ["scope:doggos" "scope:shared"] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21

    Slide 102

    Slide 102 text

    "@nx/enforce-module-boundaries": [ "error", { "enforceBuildableLibDependency": true, "allow": [], "depConstraints": [ { "sourceTag": "scope:doggo-rating-app", "onlyDependOnLibsWithTags": [ "scope:doggos", "scope:about", "scope:shared" ] }, { "sourceTag": "scope:about", "onlyDependOnLibsWithTags": ["scope:about", "scope:shared"] }, { "sourceTag": "scope:doggos", "onlyDependOnLibsWithTags": ["scope:doggos" "scope:shared"] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 "@nx/enforce-module-boundaries": [ 1 "error", 2 { 3 "enforceBuildableLibDependency": true, 4 "allow": [], 5 "depConstraints": [ 6 { 7 "sourceTag": "scope:doggo-rating-app", 8 "onlyDependOnLibsWithTags": [ 9 "scope:doggos", 10 "scope:about", 11 "scope:shared" 12 ] 13 }, 14 { 15 "sourceTag": "scope:about", 16 "onlyDependOnLibsWithTags": ["scope:about", "scope:shared"] 17 }, 18 { 19 "sourceTag": "scope:doggos", 20 "onlyDependOnLibsWithTags": ["scope:doggos" "scope:shared"] 21

    Slide 103

    Slide 103 text

    "@nx/enforce-module-boundaries": [ "error", { "enforceBuildableLibDependency": true, "allow": [], "depConstraints": [ { "sourceTag": "scope:doggo-rating-app", "onlyDependOnLibsWithTags": [ "scope:doggos", "scope:about", "scope:shared" ] }, { "sourceTag": "scope:about", "onlyDependOnLibsWithTags": ["scope:about", "scope:shared"] }, { "sourceTag": "scope:doggos", "onlyDependOnLibsWithTags": ["scope:doggos" "scope:shared"] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 "@nx/enforce-module-boundaries": [ 1 "error", 2 { 3 "enforceBuildableLibDependency": true, 4 "allow": [], 5 "depConstraints": [ 6 { 7 "sourceTag": "scope:doggo-rating-app", 8 "onlyDependOnLibsWithTags": [ 9 "scope:doggos", 10 "scope:about", 11 "scope:shared" 12 ] 13 }, 14 { 15 "sourceTag": "scope:about", 16 "onlyDependOnLibsWithTags": ["scope:about", "scope:shared"] 17 }, 18 { 19 "sourceTag": "scope:doggos", 20 "onlyDependOnLibsWithTags": ["scope:doggos" "scope:shared"] 21 "depConstraints": [ "@nx/enforce-module-boundaries": [ 1 "error", 2 { 3 "enforceBuildableLibDependency": true, 4 "allow": [], 5 6 { 7 "sourceTag": "scope:doggo-rating-app", 8 "onlyDependOnLibsWithTags": [ 9 "scope:doggos", 10 "scope:about", 11 "scope:shared" 12 ] 13 }, 14 { 15 "sourceTag": "scope:about", 16 "onlyDependOnLibsWithTags": ["scope:about", "scope:shared"] 17 }, 18 { 19 "sourceTag": "scope:doggos", 20 "onlyDependOnLibsWithTags": ["scope:doggos" "scope:shared"] 21

    Slide 104

    Slide 104 text

    "@nx/enforce-module-boundaries": [ "error", { "enforceBuildableLibDependency": true, "allow": [], "depConstraints": [ { "sourceTag": "scope:doggo-rating-app", "onlyDependOnLibsWithTags": [ "scope:doggos", "scope:about", "scope:shared" ] }, { "sourceTag": "scope:about", "onlyDependOnLibsWithTags": ["scope:about", "scope:shared"] }, { "sourceTag": "scope:doggos", "onlyDependOnLibsWithTags": ["scope:doggos" "scope:shared"] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 "@nx/enforce-module-boundaries": [ 1 "error", 2 { 3 "enforceBuildableLibDependency": true, 4 "allow": [], 5 "depConstraints": [ 6 { 7 "sourceTag": "scope:doggo-rating-app", 8 "onlyDependOnLibsWithTags": [ 9 "scope:doggos", 10 "scope:about", 11 "scope:shared" 12 ] 13 }, 14 { 15 "sourceTag": "scope:about", 16 "onlyDependOnLibsWithTags": ["scope:about", "scope:shared"] 17 }, 18 { 19 "sourceTag": "scope:doggos", 20 "onlyDependOnLibsWithTags": ["scope:doggos" "scope:shared"] 21 "depConstraints": [ "@nx/enforce-module-boundaries": [ 1 "error", 2 { 3 "enforceBuildableLibDependency": true, 4 "allow": [], 5 6 { 7 "sourceTag": "scope:doggo-rating-app", 8 "onlyDependOnLibsWithTags": [ 9 "scope:doggos", 10 "scope:about", 11 "scope:shared" 12 ] 13 }, 14 { 15 "sourceTag": "scope:about", 16 "onlyDependOnLibsWithTags": ["scope:about", "scope:shared"] 17 }, 18 { 19 "sourceTag": "scope:doggos", 20 "onlyDependOnLibsWithTags": ["scope:doggos" "scope:shared"] 21 { "sourceTag": "scope:doggo-rating-app", "onlyDependOnLibsWithTags": [ "scope:doggos", "scope:about", "scope:shared" ] }, "@nx/enforce-module-boundaries": [ 1 "error", 2 { 3 "enforceBuildableLibDependency": true, 4 "allow": [], 5 "depConstraints": [ 6 7 8 9 10 11 12 13 14 { 15 "sourceTag": "scope:about", 16 "onlyDependOnLibsWithTags": ["scope:about", "scope:shared"] 17 }, 18 { 19 "sourceTag": "scope:doggos", 20 "onlyDependOnLibsWithTags": ["scope:doggos", "scope:shared"] 21

    Slide 105

    Slide 105 text

    "@nx/enforce-module-boundaries": [ "error", { "enforceBuildableLibDependency": true, "allow": [], "depConstraints": [ { "sourceTag": "scope:doggo-rating-app", "onlyDependOnLibsWithTags": [ "scope:doggos", "scope:about", "scope:shared" ] }, { "sourceTag": "scope:about", "onlyDependOnLibsWithTags": ["scope:about", "scope:shared"] }, { "sourceTag": "scope:doggos", "onlyDependOnLibsWithTags": ["scope:doggos" "scope:shared"] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 "@nx/enforce-module-boundaries": [ 1 "error", 2 { 3 "enforceBuildableLibDependency": true, 4 "allow": [], 5 "depConstraints": [ 6 { 7 "sourceTag": "scope:doggo-rating-app", 8 "onlyDependOnLibsWithTags": [ 9 "scope:doggos", 10 "scope:about", 11 "scope:shared" 12 ] 13 }, 14 { 15 "sourceTag": "scope:about", 16 "onlyDependOnLibsWithTags": ["scope:about", "scope:shared"] 17 }, 18 { 19 "sourceTag": "scope:doggos", 20 "onlyDependOnLibsWithTags": ["scope:doggos" "scope:shared"] 21 "depConstraints": [ "@nx/enforce-module-boundaries": [ 1 "error", 2 { 3 "enforceBuildableLibDependency": true, 4 "allow": [], 5 6 { 7 "sourceTag": "scope:doggo-rating-app", 8 "onlyDependOnLibsWithTags": [ 9 "scope:doggos", 10 "scope:about", 11 "scope:shared" 12 ] 13 }, 14 { 15 "sourceTag": "scope:about", 16 "onlyDependOnLibsWithTags": ["scope:about", "scope:shared"] 17 }, 18 { 19 "sourceTag": "scope:doggos", 20 "onlyDependOnLibsWithTags": ["scope:doggos" "scope:shared"] 21 { "sourceTag": "scope:doggo-rating-app", "onlyDependOnLibsWithTags": [ "scope:doggos", "scope:about", "scope:shared" ] }, "@nx/enforce-module-boundaries": [ 1 "error", 2 { 3 "enforceBuildableLibDependency": true, 4 "allow": [], 5 "depConstraints": [ 6 7 8 9 10 11 12 13 14 { 15 "sourceTag": "scope:about", 16 "onlyDependOnLibsWithTags": ["scope:about", "scope:shared"] 17 }, 18 { 19 "sourceTag": "scope:doggos", 20 "onlyDependOnLibsWithTags": ["scope:doggos" "scope:shared"] 21 { "sourceTag": "scope:about", "onlyDependOnLibsWithTags": ["scope:about", "scope:shared"] }, [], "depConstraints": [ 6 { 7 "sourceTag": "scope:doggo-rating-app", 8 "onlyDependOnLibsWithTags": [ 9 "scope:doggos", 10 "scope:about", 11 "scope:shared" 12 ] 13 }, 14 15 16 17 18 { 19 "sourceTag": "scope:doggos", 20 "onlyDependOnLibsWithTags": ["scope:doggos", "scope:shared"] 21 }, 22 { 23 "sourceTag": "scope:shared", 24 "onlyDependOnLibsWithTags": ["scope:shared"] 25 }, 26 { 27

    Slide 106

    Slide 106 text

    "@nx/enforce-module-boundaries": [ "error", { "enforceBuildableLibDependency": true, "allow": [], "depConstraints": [ { "sourceTag": "scope:doggo-rating-app", "onlyDependOnLibsWithTags": [ "scope:doggos", "scope:about", "scope:shared" ] }, { "sourceTag": "scope:about", "onlyDependOnLibsWithTags": ["scope:about", "scope:shared"] }, { "sourceTag": "scope:doggos", "onlyDependOnLibsWithTags": ["scope:doggos" "scope:shared"] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 "@nx/enforce-module-boundaries": [ 1 "error", 2 { 3 "enforceBuildableLibDependency": true, 4 "allow": [], 5 "depConstraints": [ 6 { 7 "sourceTag": "scope:doggo-rating-app", 8 "onlyDependOnLibsWithTags": [ 9 "scope:doggos", 10 "scope:about", 11 "scope:shared" 12 ] 13 }, 14 { 15 "sourceTag": "scope:about", 16 "onlyDependOnLibsWithTags": ["scope:about", "scope:shared"] 17 }, 18 { 19 "sourceTag": "scope:doggos", 20 "onlyDependOnLibsWithTags": ["scope:doggos" "scope:shared"] 21 "depConstraints": [ "@nx/enforce-module-boundaries": [ 1 "error", 2 { 3 "enforceBuildableLibDependency": true, 4 "allow": [], 5 6 { 7 "sourceTag": "scope:doggo-rating-app", 8 "onlyDependOnLibsWithTags": [ 9 "scope:doggos", 10 "scope:about", 11 "scope:shared" 12 ] 13 }, 14 { 15 "sourceTag": "scope:about", 16 "onlyDependOnLibsWithTags": ["scope:about", "scope:shared"] 17 }, 18 { 19 "sourceTag": "scope:doggos", 20 "onlyDependOnLibsWithTags": ["scope:doggos" "scope:shared"] 21 { "sourceTag": "scope:doggo-rating-app", "onlyDependOnLibsWithTags": [ "scope:doggos", "scope:about", "scope:shared" ] }, "@nx/enforce-module-boundaries": [ 1 "error", 2 { 3 "enforceBuildableLibDependency": true, 4 "allow": [], 5 "depConstraints": [ 6 7 8 9 10 11 12 13 14 { 15 "sourceTag": "scope:about", 16 "onlyDependOnLibsWithTags": ["scope:about", "scope:shared"] 17 }, 18 { 19 "sourceTag": "scope:doggos", 20 "onlyDependOnLibsWithTags": ["scope:doggos" "scope:shared"] 21 { "sourceTag": "scope:about", "onlyDependOnLibsWithTags": ["scope:about", "scope:shared"] }, "@nx/enforce-module-boundaries": [ 1 "error", 2 { 3 "enforceBuildableLibDependency": true, 4 "allow": [], 5 "depConstraints": [ 6 { 7 "sourceTag": "scope:doggo-rating-app", 8 "onlyDependOnLibsWithTags": [ 9 "scope:doggos", 10 "scope:about", 11 "scope:shared" 12 ] 13 }, 14 15 16 17 18 { 19 "sourceTag": "scope:doggos", 20 "onlyDependOnLibsWithTags": ["scope:doggos" "scope:shared"] 21 { "sourceTag": "scope:doggos", "onlyDependOnLibsWithTags": ["scope:doggos", "scope:shared"] }, y p g [ "scope:doggos", 10 "scope:about", 11 "scope:shared" 12 ] 13 }, 14 { 15 "sourceTag": "scope:about", 16 "onlyDependOnLibsWithTags": ["scope:about", "scope:shared"] 17 }, 18 19 20 21 22 { 23 "sourceTag": "scope:shared", 24 "onlyDependOnLibsWithTags": ["scope:shared"] 25 }, 26 { 27 "sourceTag": "type:app", 28 "onlyDependOnLibsWithTags": [ 29 "type:feature", 30 "type:util", 31

    Slide 107

    Slide 107 text

    No content

    Slide 108

    Slide 108 text

    https://go.nx.dev/angular-enterprise-monorepo-patterns-new-book

    Slide 109

    Slide 109 text

    No content

    Slide 110

    Slide 110 text

    @Component({ selector: 'app-my-doggos', standalone: true, templateUrl: './my-doggos.component.html', styleUrls: ['./my-doggos.component.css'], imports: [AsyncPipe, RouterLink, DatePipe, DecimalPipe, NgFor], }) export class MyDoggosComponent implements OnInit { private readonly store = inject(Store); doggos = this.store.select(getMyDoggos); ngOnInit(): void { this.store.dispatch(DoggosActions.loadMyDoggos()); } deleteDoggo(doggo: Doggo) { this.store.dispatch(DoggosActions.deleteDoggo({ doggo })); } } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20

    Slide 111

    Slide 111 text

    @Component({ selector: 'app-my-doggos', standalone: true, templateUrl: './my-doggos.component.html', styleUrls: ['./my-doggos.component.css'], imports: [AsyncPipe, RouterLink, DatePipe, DecimalPipe, NgFor], }) export class MyDoggosComponent implements OnInit { private readonly store = inject(Store); doggos = this.store.select(getMyDoggos); ngOnInit(): void { this.store.dispatch(DoggosActions.loadMyDoggos()); } deleteDoggo(doggo: Doggo) { this.store.dispatch(DoggosActions.deleteDoggo({ doggo })); } } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 doggos = this.store.select(getMyDoggos); @Component({ 1 selector: 'app-my-doggos', 2 standalone: true, 3 templateUrl: './my-doggos.component.html', 4 styleUrls: ['./my-doggos.component.css'], 5 imports: [AsyncPipe, RouterLink, DatePipe, DecimalPipe, NgFor], 6 }) 7 export class MyDoggosComponent implements OnInit { 8 private readonly store = inject(Store); 9 10 11 12 ngOnInit(): void { 13 this.store.dispatch(DoggosActions.loadMyDoggos()); 14 } 15 16 deleteDoggo(doggo: Doggo) { 17 this.store.dispatch(DoggosActions.deleteDoggo({ doggo })); 18 } 19 } 20

    Slide 112

    Slide 112 text

    doggos = this.store.selectSignal(getMyDoggos); @Component({ 1 selector: 'app-my-doggos', 2 standalone: true, 3 templateUrl: './my-doggos.component.html', 4 styleUrls: ['./my-doggos.component.css'], 5 imports: [AsyncPipe, RouterLink, DatePipe, DecimalPipe, NgFor], 6 }) 7 export class MyDoggosComponent implements OnInit { 8 private readonly store = inject(Store); 9 10 11 12 ngOnInit(): void { 13 this.store.dispatch(DoggosActions.loadMyDoggos()); 14 } 15 16 deleteDoggo(doggo: Doggo) { 17 this.store.dispatch(DoggosActions.deleteDoggo({ doggo })); 18 } 19 } 20

    Slide 113

    Slide 113 text

    No content

    Slide 114

    Slide 114 text

    No content

    Slide 115

    Slide 115 text

    No content

    Slide 116

    Slide 116 text

    No content

    Slide 117

    Slide 117 text

    No content

    Slide 118

    Slide 118 text

    No content