feat(doc): move projection

This commit is contained in:
thomas
2023-10-18 10:03:54 +02:00
parent fedab5eeb1
commit 01a41ed13f
36 changed files with 40 additions and 44 deletions

View File

@@ -1,5 +1,5 @@
{
"extends": ["../../.eslintrc.json"],
"extends": ["../../../.eslintrc.json"],
"ignorePatterns": ["!**/*"],
"overrides": [
{

View File

@@ -5,9 +5,9 @@
### Run Application
```bash
npx nx serve projection
npx nx serve angular-projection
```
### Documentation and Instruction
Challenge documentation is [here](https://angular-challenges.vercel.app/challenges/angular/1-projection/).
Challenge documentation is [here](https://angular-challenges.vercel.app/challenges/angular/1-angular-projection/).

View File

@@ -1,10 +1,10 @@
/* eslint-disable */
export default {
displayName: 'projection',
preset: '../../jest.preset.js',
displayName: 'angular-projection',
preset: '../../../jest.preset.js',
setupFilesAfterEnv: ['<rootDir>/src/test-setup.ts'],
globals: {},
coverageDirectory: '../../coverage/apps/projection',
coverageDirectory: '../../../coverage/apps/angular/projection',
transform: {
'^.+\\.(ts|mjs|js|html)$': [
'jest-preset-angular',

View File

@@ -1,25 +1,25 @@
{
"name": "projection",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"name": "angular-projection",
"$schema": "../../../node_modules/nx/schemas/project-schema.json",
"projectType": "application",
"sourceRoot": "apps/projection/src",
"sourceRoot": "apps/angular/projection/src",
"prefix": "app",
"targets": {
"build": {
"executor": "@angular-devkit/build-angular:browser",
"outputs": ["{options.outputPath}"],
"options": {
"outputPath": "dist/apps/projection",
"index": "apps/projection/src/index.html",
"main": "apps/projection/src/main.ts",
"polyfills": "apps/projection/src/polyfills.ts",
"tsConfig": "apps/projection/tsconfig.app.json",
"outputPath": "dist/apps/angular/projection",
"index": "apps/angular/projection/src/index.html",
"main": "apps/angular/projection/src/main.ts",
"polyfills": "apps/angular/projection/src/polyfills.ts",
"tsConfig": "apps/angular/projection/tsconfig.app.json",
"inlineStyleLanguage": "scss",
"assets": [
"apps/projection/src/favicon.ico",
"apps/projection/src/assets"
"apps/angular/projection/src/favicon.ico",
"apps/angular/projection/src/assets"
],
"styles": ["apps/projection/src/styles.scss"],
"styles": ["apps/angular/projection/src/styles.scss"],
"scripts": [],
"allowedCommonJsDependencies": ["seedrandom"]
},
@@ -39,8 +39,8 @@
],
"fileReplacements": [
{
"replace": "apps/projection/src/environments/environment.ts",
"with": "apps/projection/src/environments/environment.prod.ts"
"replace": "apps/angular/projection/src/environments/environment.ts",
"with": "apps/angular/projection/src/environments/environment.prod.ts"
}
],
"outputHashing": "all"
@@ -60,10 +60,10 @@
"executor": "@angular-devkit/build-angular:dev-server",
"configurations": {
"production": {
"browserTarget": "projection:build:production"
"browserTarget": "angular-projection:build:production"
},
"development": {
"browserTarget": "projection:build:development"
"browserTarget": "angular-projection:build:development"
}
},
"defaultConfiguration": "development"
@@ -71,15 +71,15 @@
"extract-i18n": {
"executor": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "projection:build"
"browserTarget": "angular-projection:build"
}
},
"lint": {
"executor": "@nx/linter:eslint",
"options": {
"lintFilePatterns": [
"apps/projection/**/*.ts",
"apps/projection/**/*.html"
"apps/angular/projection/**/*.ts",
"apps/angular/projection/**/*.html"
]
}
},
@@ -87,7 +87,7 @@
"executor": "@nx/jest:jest",
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
"options": {
"jestConfig": "apps/projection/jest.config.ts",
"jestConfig": "apps/angular/projection/jest.config.ts",
"passWithNoTests": true
}
}

View File

@@ -10,8 +10,7 @@ import { CardComponent } from '../../ui/card/card.component';
template: `<app-card
[list]="students"
[type]="cardType"
customClass="bg-light-green"
></app-card>`,
customClass="bg-light-green"></app-card>`,
standalone: true,
styles: [
`

View File

@@ -10,8 +10,7 @@ import { CardComponent } from '../../ui/card/card.component';
template: `<app-card
[list]="teachers"
[type]="cardType"
customClass="bg-light-red"
></app-card>`,
customClass="bg-light-red"></app-card>`,
styles: [
`
::ng-deep .bg-light-red {

View File

@@ -5,7 +5,7 @@ export const subject = [
'Maths',
'Sport',
] as const;
export type Subject = typeof subject[number];
export type Subject = (typeof subject)[number];
export interface Teacher {
id: number;

View File

@@ -1,29 +1,27 @@
<div class="border-2 border-black rounded-md p-4 w-fit flex flex-col gap-3" [class]="customClass">
<div
class="border-2 border-black rounded-md p-4 w-fit flex flex-col gap-3"
[class]="customClass">
<img
*ngIf="type === CardType.TEACHER"
src="assets/img/teacher.png"
width="200px"
/>
width="200px" />
<img
*ngIf="type === CardType.STUDENT"
src="assets/img/student.webp"
width="200px"
/>
width="200px" />
<section>
<app-list-item
*ngFor="let item of list"
[name]="item.firstname"
[id]="item.id"
[type]="type"
>
[type]="type">
</app-list-item>
</section>
<button
class="border border-blue-500 bg-blue-300 p-2 rounded-sm"
(click)="addNewItem()"
>
(click)="addNewItem()">
Add
</button>
</div>

View File

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 32 KiB

View File

Before

Width:  |  Height:  |  Size: 88 KiB

After

Width:  |  Height:  |  Size: 88 KiB

View File

Before

Width:  |  Height:  |  Size: 502 B

After

Width:  |  Height:  |  Size: 502 B

View File

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

View File

@@ -1,3 +1,3 @@
@tailwind base;
@tailwind components;
@tailwind utilities;
@tailwind utilities;

View File

@@ -1,7 +1,7 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "../../dist/out-tsc",
"outDir": "../../../dist/out-tsc",
"types": [],
"target": "ES2022",
"useDefineForClassFields": false

View File

@@ -1,5 +1,5 @@
{
"extends": "../../tsconfig.base.json",
"extends": "../../../tsconfig.base.json",
"files": [],
"include": [],
"references": [

View File

@@ -1,7 +1,7 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "../../dist/out-tsc",
"outDir": "../../../dist/out-tsc",
"module": "commonjs",
"types": ["jest", "node"]
},

View File

@@ -82,5 +82,5 @@
"standalone": "true"
}
},
"defaultProject": "projection"
"defaultProject": "angular-projection"
}