mirror of
https://github.com/Raghu-Ch/angular-challenges.git
synced 2026-02-13 06:13:03 -05:00
feat: challenge 42
This commit is contained in:
26
apps/nx/static-dynamic-import/src/app/app.component.ts
Normal file
26
apps/nx/static-dynamic-import/src/app/app.component.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
import {
|
||||
UserPipe,
|
||||
type User,
|
||||
} from '@angular-challenges/static-dynamic-import/users';
|
||||
import { Component } from '@angular/core';
|
||||
import { RouterOutlet } from '@angular/router';
|
||||
|
||||
@Component({
|
||||
standalone: true,
|
||||
imports: [UserPipe, RouterOutlet],
|
||||
selector: 'app-root',
|
||||
template: `
|
||||
Author: {{ author | user }}
|
||||
<router-outlet />
|
||||
`,
|
||||
host: {
|
||||
class: 'flex flex-col',
|
||||
},
|
||||
})
|
||||
export class AppComponent {
|
||||
author: User = {
|
||||
name: 'Thomas',
|
||||
lastname: 'Laforge',
|
||||
country: 'France',
|
||||
};
|
||||
}
|
||||
14
apps/nx/static-dynamic-import/src/app/app.config.ts
Normal file
14
apps/nx/static-dynamic-import/src/app/app.config.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
import { ApplicationConfig } from '@angular/core';
|
||||
import { provideRouter } from '@angular/router';
|
||||
|
||||
export const appConfig: ApplicationConfig = {
|
||||
providers: [
|
||||
provideRouter([
|
||||
{
|
||||
path: '',
|
||||
loadComponent: () =>
|
||||
import('@angular-challenges/static-dynamic-import/users'),
|
||||
},
|
||||
]),
|
||||
],
|
||||
};
|
||||
Reference in New Issue
Block a user