feat: challenge 42

This commit is contained in:
thomas
2024-01-02 09:51:18 +01:00
parent 68178c6d76
commit e619bc403b
31 changed files with 656 additions and 7 deletions

View 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',
};
}

View 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'),
},
]),
],
};

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

View File

@@ -0,0 +1,13 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>nx-static-dynamic-import</title>
<base href="/" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="icon" type="image/x-icon" href="favicon.ico" />
</head>
<body>
<app-root></app-root>
</body>
</html>

View File

@@ -0,0 +1,7 @@
import { bootstrapApplication } from '@angular/platform-browser';
import { AppComponent } from './app/app.component';
import { appConfig } from './app/app.config';
bootstrapApplication(AppComponent, appConfig).catch((err) =>
console.error(err),
);

View File

@@ -0,0 +1,5 @@
@tailwind base;
@tailwind components;
@tailwind utilities;
/* You can add global styles to this file, and also import other style files */