mirror of
https://github.com/Raghu-Ch/angular-challenges.git
synced 2026-02-12 22:03: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'),
|
||||
},
|
||||
]),
|
||||
],
|
||||
};
|
||||
0
apps/nx/static-dynamic-import/src/assets/.gitkeep
Normal file
0
apps/nx/static-dynamic-import/src/assets/.gitkeep
Normal file
BIN
apps/nx/static-dynamic-import/src/favicon.ico
Normal file
BIN
apps/nx/static-dynamic-import/src/favicon.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 15 KiB |
13
apps/nx/static-dynamic-import/src/index.html
Normal file
13
apps/nx/static-dynamic-import/src/index.html
Normal 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>
|
||||
7
apps/nx/static-dynamic-import/src/main.ts
Normal file
7
apps/nx/static-dynamic-import/src/main.ts
Normal 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),
|
||||
);
|
||||
5
apps/nx/static-dynamic-import/src/styles.scss
Normal file
5
apps/nx/static-dynamic-import/src/styles.scss
Normal 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 */
|
||||
Reference in New Issue
Block a user