feat(doc): move projection
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"extends": ["../../.eslintrc.json"],
|
"extends": ["../../../.eslintrc.json"],
|
||||||
"ignorePatterns": ["!**/*"],
|
"ignorePatterns": ["!**/*"],
|
||||||
"overrides": [
|
"overrides": [
|
||||||
{
|
{
|
||||||
@@ -5,9 +5,9 @@
|
|||||||
### Run Application
|
### Run Application
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
npx nx serve projection
|
npx nx serve angular-projection
|
||||||
```
|
```
|
||||||
|
|
||||||
### Documentation and Instruction
|
### 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/).
|
||||||
@@ -1,10 +1,10 @@
|
|||||||
/* eslint-disable */
|
/* eslint-disable */
|
||||||
export default {
|
export default {
|
||||||
displayName: 'projection',
|
displayName: 'angular-projection',
|
||||||
preset: '../../jest.preset.js',
|
preset: '../../../jest.preset.js',
|
||||||
setupFilesAfterEnv: ['<rootDir>/src/test-setup.ts'],
|
setupFilesAfterEnv: ['<rootDir>/src/test-setup.ts'],
|
||||||
globals: {},
|
globals: {},
|
||||||
coverageDirectory: '../../coverage/apps/projection',
|
coverageDirectory: '../../../coverage/apps/angular/projection',
|
||||||
transform: {
|
transform: {
|
||||||
'^.+\\.(ts|mjs|js|html)$': [
|
'^.+\\.(ts|mjs|js|html)$': [
|
||||||
'jest-preset-angular',
|
'jest-preset-angular',
|
||||||
@@ -1,25 +1,25 @@
|
|||||||
{
|
{
|
||||||
"name": "projection",
|
"name": "angular-projection",
|
||||||
"$schema": "../../node_modules/nx/schemas/project-schema.json",
|
"$schema": "../../../node_modules/nx/schemas/project-schema.json",
|
||||||
"projectType": "application",
|
"projectType": "application",
|
||||||
"sourceRoot": "apps/projection/src",
|
"sourceRoot": "apps/angular/projection/src",
|
||||||
"prefix": "app",
|
"prefix": "app",
|
||||||
"targets": {
|
"targets": {
|
||||||
"build": {
|
"build": {
|
||||||
"executor": "@angular-devkit/build-angular:browser",
|
"executor": "@angular-devkit/build-angular:browser",
|
||||||
"outputs": ["{options.outputPath}"],
|
"outputs": ["{options.outputPath}"],
|
||||||
"options": {
|
"options": {
|
||||||
"outputPath": "dist/apps/projection",
|
"outputPath": "dist/apps/angular/projection",
|
||||||
"index": "apps/projection/src/index.html",
|
"index": "apps/angular/projection/src/index.html",
|
||||||
"main": "apps/projection/src/main.ts",
|
"main": "apps/angular/projection/src/main.ts",
|
||||||
"polyfills": "apps/projection/src/polyfills.ts",
|
"polyfills": "apps/angular/projection/src/polyfills.ts",
|
||||||
"tsConfig": "apps/projection/tsconfig.app.json",
|
"tsConfig": "apps/angular/projection/tsconfig.app.json",
|
||||||
"inlineStyleLanguage": "scss",
|
"inlineStyleLanguage": "scss",
|
||||||
"assets": [
|
"assets": [
|
||||||
"apps/projection/src/favicon.ico",
|
"apps/angular/projection/src/favicon.ico",
|
||||||
"apps/projection/src/assets"
|
"apps/angular/projection/src/assets"
|
||||||
],
|
],
|
||||||
"styles": ["apps/projection/src/styles.scss"],
|
"styles": ["apps/angular/projection/src/styles.scss"],
|
||||||
"scripts": [],
|
"scripts": [],
|
||||||
"allowedCommonJsDependencies": ["seedrandom"]
|
"allowedCommonJsDependencies": ["seedrandom"]
|
||||||
},
|
},
|
||||||
@@ -39,8 +39,8 @@
|
|||||||
],
|
],
|
||||||
"fileReplacements": [
|
"fileReplacements": [
|
||||||
{
|
{
|
||||||
"replace": "apps/projection/src/environments/environment.ts",
|
"replace": "apps/angular/projection/src/environments/environment.ts",
|
||||||
"with": "apps/projection/src/environments/environment.prod.ts"
|
"with": "apps/angular/projection/src/environments/environment.prod.ts"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"outputHashing": "all"
|
"outputHashing": "all"
|
||||||
@@ -60,10 +60,10 @@
|
|||||||
"executor": "@angular-devkit/build-angular:dev-server",
|
"executor": "@angular-devkit/build-angular:dev-server",
|
||||||
"configurations": {
|
"configurations": {
|
||||||
"production": {
|
"production": {
|
||||||
"browserTarget": "projection:build:production"
|
"browserTarget": "angular-projection:build:production"
|
||||||
},
|
},
|
||||||
"development": {
|
"development": {
|
||||||
"browserTarget": "projection:build:development"
|
"browserTarget": "angular-projection:build:development"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"defaultConfiguration": "development"
|
"defaultConfiguration": "development"
|
||||||
@@ -71,15 +71,15 @@
|
|||||||
"extract-i18n": {
|
"extract-i18n": {
|
||||||
"executor": "@angular-devkit/build-angular:extract-i18n",
|
"executor": "@angular-devkit/build-angular:extract-i18n",
|
||||||
"options": {
|
"options": {
|
||||||
"browserTarget": "projection:build"
|
"browserTarget": "angular-projection:build"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"lint": {
|
"lint": {
|
||||||
"executor": "@nx/linter:eslint",
|
"executor": "@nx/linter:eslint",
|
||||||
"options": {
|
"options": {
|
||||||
"lintFilePatterns": [
|
"lintFilePatterns": [
|
||||||
"apps/projection/**/*.ts",
|
"apps/angular/projection/**/*.ts",
|
||||||
"apps/projection/**/*.html"
|
"apps/angular/projection/**/*.html"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -87,7 +87,7 @@
|
|||||||
"executor": "@nx/jest:jest",
|
"executor": "@nx/jest:jest",
|
||||||
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
|
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
|
||||||
"options": {
|
"options": {
|
||||||
"jestConfig": "apps/projection/jest.config.ts",
|
"jestConfig": "apps/angular/projection/jest.config.ts",
|
||||||
"passWithNoTests": true
|
"passWithNoTests": true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -10,8 +10,7 @@ import { CardComponent } from '../../ui/card/card.component';
|
|||||||
template: `<app-card
|
template: `<app-card
|
||||||
[list]="students"
|
[list]="students"
|
||||||
[type]="cardType"
|
[type]="cardType"
|
||||||
customClass="bg-light-green"
|
customClass="bg-light-green"></app-card>`,
|
||||||
></app-card>`,
|
|
||||||
standalone: true,
|
standalone: true,
|
||||||
styles: [
|
styles: [
|
||||||
`
|
`
|
||||||
@@ -10,8 +10,7 @@ import { CardComponent } from '../../ui/card/card.component';
|
|||||||
template: `<app-card
|
template: `<app-card
|
||||||
[list]="teachers"
|
[list]="teachers"
|
||||||
[type]="cardType"
|
[type]="cardType"
|
||||||
customClass="bg-light-red"
|
customClass="bg-light-red"></app-card>`,
|
||||||
></app-card>`,
|
|
||||||
styles: [
|
styles: [
|
||||||
`
|
`
|
||||||
::ng-deep .bg-light-red {
|
::ng-deep .bg-light-red {
|
||||||
@@ -5,7 +5,7 @@ export const subject = [
|
|||||||
'Maths',
|
'Maths',
|
||||||
'Sport',
|
'Sport',
|
||||||
] as const;
|
] as const;
|
||||||
export type Subject = typeof subject[number];
|
export type Subject = (typeof subject)[number];
|
||||||
|
|
||||||
export interface Teacher {
|
export interface Teacher {
|
||||||
id: number;
|
id: number;
|
||||||
@@ -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
|
<img
|
||||||
*ngIf="type === CardType.TEACHER"
|
*ngIf="type === CardType.TEACHER"
|
||||||
src="assets/img/teacher.png"
|
src="assets/img/teacher.png"
|
||||||
width="200px"
|
width="200px" />
|
||||||
/>
|
|
||||||
<img
|
<img
|
||||||
*ngIf="type === CardType.STUDENT"
|
*ngIf="type === CardType.STUDENT"
|
||||||
src="assets/img/student.webp"
|
src="assets/img/student.webp"
|
||||||
width="200px"
|
width="200px" />
|
||||||
/>
|
|
||||||
|
|
||||||
<section>
|
<section>
|
||||||
<app-list-item
|
<app-list-item
|
||||||
*ngFor="let item of list"
|
*ngFor="let item of list"
|
||||||
[name]="item.firstname"
|
[name]="item.firstname"
|
||||||
[id]="item.id"
|
[id]="item.id"
|
||||||
[type]="type"
|
[type]="type">
|
||||||
>
|
|
||||||
</app-list-item>
|
</app-list-item>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<button
|
<button
|
||||||
class="border border-blue-500 bg-blue-300 p-2 rounded-sm"
|
class="border border-blue-500 bg-blue-300 p-2 rounded-sm"
|
||||||
(click)="addNewItem()"
|
(click)="addNewItem()">
|
||||||
>
|
|
||||||
Add
|
Add
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 32 KiB |
|
Before Width: | Height: | Size: 88 KiB After Width: | Height: | Size: 88 KiB |
|
Before Width: | Height: | Size: 502 B After Width: | Height: | Size: 502 B |
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
@@ -1,3 +1,3 @@
|
|||||||
@tailwind base;
|
@tailwind base;
|
||||||
@tailwind components;
|
@tailwind components;
|
||||||
@tailwind utilities;
|
@tailwind utilities;
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"extends": "./tsconfig.json",
|
"extends": "./tsconfig.json",
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"outDir": "../../dist/out-tsc",
|
"outDir": "../../../dist/out-tsc",
|
||||||
"types": [],
|
"types": [],
|
||||||
"target": "ES2022",
|
"target": "ES2022",
|
||||||
"useDefineForClassFields": false
|
"useDefineForClassFields": false
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"extends": "../../tsconfig.base.json",
|
"extends": "../../../tsconfig.base.json",
|
||||||
"files": [],
|
"files": [],
|
||||||
"include": [],
|
"include": [],
|
||||||
"references": [
|
"references": [
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"extends": "./tsconfig.json",
|
"extends": "./tsconfig.json",
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"outDir": "../../dist/out-tsc",
|
"outDir": "../../../dist/out-tsc",
|
||||||
"module": "commonjs",
|
"module": "commonjs",
|
||||||
"types": ["jest", "node"]
|
"types": ["jest", "node"]
|
||||||
},
|
},
|
||||||