refactor: move libs
@@ -4,23 +4,16 @@
|
|||||||
"overrides": [
|
"overrides": [
|
||||||
{
|
{
|
||||||
"files": ["*.ts"],
|
"files": ["*.ts"],
|
||||||
|
"rules": {},
|
||||||
"extends": [
|
"extends": [
|
||||||
"plugin:@nx/angular",
|
"plugin:@nx/angular",
|
||||||
"plugin:@angular-eslint/template/process-inline-templates"
|
"plugin:@angular-eslint/template/process-inline-templates"
|
||||||
],
|
]
|
||||||
"rules": {}
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"files": ["*.html"],
|
"files": ["*.html"],
|
||||||
"extends": ["plugin:@nx/angular-template"],
|
"extends": ["plugin:@nx/angular-template"],
|
||||||
"rules": {}
|
"rules": {}
|
||||||
},
|
|
||||||
{
|
|
||||||
"files": ["*.json"],
|
|
||||||
"parser": "jsonc-eslint-parser",
|
|
||||||
"rules": {
|
|
||||||
"@nx/dependency-checks": "error"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,13 @@
|
|||||||
# angular-master-dependency-injection
|
# Master Dependancy Injection
|
||||||
|
|
||||||
This library was generated with [Nx](https://nx.dev).
|
> author: thomas-laforge
|
||||||
|
|
||||||
## Running unit tests
|
### Run Application
|
||||||
|
|
||||||
Run `nx test angular-master-dependency-injection` to execute the unit tests.
|
```bash
|
||||||
|
npx nx serve angular-master-dependency-injection
|
||||||
|
```
|
||||||
|
|
||||||
|
### Documentation and Instruction
|
||||||
|
|
||||||
|
Challenge documentation is [here](https://angular-challenges.vercel.app/challenges/angular/16-di/).
|
||||||
|
|||||||
@@ -1,7 +0,0 @@
|
|||||||
{
|
|
||||||
"$schema": "../../../node_modules/ng-packagr/ng-package.schema.json",
|
|
||||||
"dest": "../../../dist/apps/angular/16-master-dependency-injection",
|
|
||||||
"lib": {
|
|
||||||
"entryFile": "src/index.ts"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "angular-master-dependency-injection",
|
|
||||||
"version": "0.0.1",
|
|
||||||
"peerDependencies": {
|
|
||||||
"@angular/common": "^16.2.0",
|
|
||||||
"@angular/core": "^16.2.0"
|
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"tslib": "^2.3.0"
|
|
||||||
},
|
|
||||||
"sideEffects": false
|
|
||||||
}
|
|
||||||
@@ -1,36 +1,77 @@
|
|||||||
{
|
{
|
||||||
"name": "angular-master-dependency-injection",
|
"name": "angular-master-dependency-injection",
|
||||||
"$schema": "../../../node_modules/nx/schemas/project-schema.json",
|
"$schema": "../../../node_modules/nx/schemas/project-schema.json",
|
||||||
|
"projectType": "application",
|
||||||
"sourceRoot": "apps/angular/16-master-dependency-injection/src",
|
"sourceRoot": "apps/angular/16-master-dependency-injection/src",
|
||||||
"prefix": "lib",
|
"prefix": "app",
|
||||||
"tags": [],
|
|
||||||
"projectType": "library",
|
|
||||||
"targets": {
|
"targets": {
|
||||||
"build": {
|
"build": {
|
||||||
"executor": "@nx/angular:ng-packagr-lite",
|
"executor": "@angular-devkit/build-angular:browser",
|
||||||
"outputs": ["{workspaceRoot}/dist/{projectRoot}"],
|
"outputs": ["{options.outputPath}"],
|
||||||
"options": {
|
"options": {
|
||||||
"project": "apps/angular/16-master-dependency-injection/ng-package.json"
|
"outputPath": "dist/apps/angular/16-master-dependency-injection",
|
||||||
|
"index": "apps/angular/16-master-dependency-injection/src/index.html",
|
||||||
|
"main": "apps/angular/16-master-dependency-injection/src/main.ts",
|
||||||
|
"polyfills": ["zone.js"],
|
||||||
|
"tsConfig": "apps/angular/16-master-dependency-injection/tsconfig.app.json",
|
||||||
|
"inlineStyleLanguage": "scss",
|
||||||
|
"assets": [
|
||||||
|
"apps/angular/16-master-dependency-injection/src/favicon.ico",
|
||||||
|
"apps/angular/16-master-dependency-injection/src/assets"
|
||||||
|
],
|
||||||
|
"styles": [
|
||||||
|
"apps/angular/16-master-dependency-injection/src/styles.scss"
|
||||||
|
],
|
||||||
|
"scripts": []
|
||||||
},
|
},
|
||||||
"configurations": {
|
"configurations": {
|
||||||
"production": {
|
"production": {
|
||||||
"tsConfig": "apps/angular/16-master-dependency-injection/tsconfig.lib.prod.json"
|
"budgets": [
|
||||||
|
{
|
||||||
|
"type": "initial",
|
||||||
|
"maximumWarning": "500kb",
|
||||||
|
"maximumError": "1mb"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "anyComponentStyle",
|
||||||
|
"maximumWarning": "2kb",
|
||||||
|
"maximumError": "4kb"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"outputHashing": "all"
|
||||||
},
|
},
|
||||||
"development": {
|
"development": {
|
||||||
"tsConfig": "apps/angular/16-master-dependency-injection/tsconfig.lib.json"
|
"buildOptimizer": false,
|
||||||
|
"optimization": false,
|
||||||
|
"vendorChunk": true,
|
||||||
|
"extractLicenses": false,
|
||||||
|
"sourceMap": true,
|
||||||
|
"namedChunks": true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"defaultConfiguration": "production"
|
"defaultConfiguration": "production"
|
||||||
},
|
},
|
||||||
"test": {
|
"serve": {
|
||||||
"executor": "@nx/jest:jest",
|
"executor": "@angular-devkit/build-angular:dev-server",
|
||||||
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
|
"configurations": {
|
||||||
|
"production": {
|
||||||
|
"buildTarget": "angular-master-dependency-injection:build:production"
|
||||||
|
},
|
||||||
|
"development": {
|
||||||
|
"buildTarget": "angular-master-dependency-injection:build:development"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"defaultConfiguration": "development"
|
||||||
|
},
|
||||||
|
"extract-i18n": {
|
||||||
|
"executor": "@angular-devkit/build-angular:extract-i18n",
|
||||||
"options": {
|
"options": {
|
||||||
"jestConfig": "apps/angular/16-master-dependency-injection/jest.config.ts"
|
"buildTarget": "angular-master-dependency-injection:build"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"lint": {
|
"lint": {
|
||||||
"executor": "@nx/eslint:lint"
|
"executor": "@nx/eslint:lint"
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
"tags": []
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
|
import { TableComponent } from '@angular-challenges/shared/ui';
|
||||||
import { AsyncPipe, NgFor } from '@angular/common';
|
import { AsyncPipe, NgFor } from '@angular/common';
|
||||||
import { Component, Directive } from '@angular/core';
|
import { Component, Directive } from '@angular/core';
|
||||||
import { TableComponent } from 'angular-master-dependency-injection';
|
|
||||||
import { CurrencyPipe } from './currency.pipe';
|
import { CurrencyPipe } from './currency.pipe';
|
||||||
import { CurrencyService } from './currency.service';
|
import { CurrencyService } from './currency.service';
|
||||||
import { Product, products } from './product.model';
|
import { Product, products } from './product.model';
|
||||||
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
@@ -1,8 +0,0 @@
|
|||||||
// @ts-expect-error https://thymikee.github.io/jest-preset-angular/docs/getting-started/test-environment
|
|
||||||
globalThis.ngJest = {
|
|
||||||
testEnvironmentOptions: {
|
|
||||||
errorOnUnknownElements: true,
|
|
||||||
errorOnUnknownProperties: true,
|
|
||||||
},
|
|
||||||
};
|
|
||||||
import 'jest-preset-angular/setup-jest';
|
|
||||||
@@ -13,10 +13,10 @@
|
|||||||
"include": [],
|
"include": [],
|
||||||
"references": [
|
"references": [
|
||||||
{
|
{
|
||||||
"path": "./tsconfig.lib.json"
|
"path": "./tsconfig.app.json"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"path": "./tsconfig.spec.json"
|
"path": "./tsconfig.editor.json"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"extends": "../../../tsconfig.base.json",
|
"extends": "../../../tsconfig.base.json",
|
||||||
|
|||||||
@@ -1,7 +0,0 @@
|
|||||||
{
|
|
||||||
"extends": "./tsconfig.lib.json",
|
|
||||||
"compilerOptions": {
|
|
||||||
"declarationMap": false
|
|
||||||
},
|
|
||||||
"angularCompilerOptions": {}
|
|
||||||
}
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
{
|
|
||||||
"extends": "./tsconfig.json",
|
|
||||||
"compilerOptions": {
|
|
||||||
"outDir": "../../../dist/out-tsc",
|
|
||||||
"module": "commonjs",
|
|
||||||
"target": "es2016",
|
|
||||||
"types": ["jest", "node"]
|
|
||||||
},
|
|
||||||
"files": ["src/test-setup.ts"],
|
|
||||||
"include": [
|
|
||||||
"jest.config.ts",
|
|
||||||
"src/**/*.test.ts",
|
|
||||||
"src/**/*.spec.ts",
|
|
||||||
"src/**/*.d.ts"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
@@ -5,7 +5,7 @@
|
|||||||
### Run Application
|
### Run Application
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
npx nx serve angular-context-outlet-type
|
npx nx serve angular-typed-context-outlet
|
||||||
```
|
```
|
||||||
|
|
||||||
### Documentation and Instruction
|
### Documentation and Instruction
|
||||||
@@ -1,25 +1,25 @@
|
|||||||
{
|
{
|
||||||
"name": "angular-context-outlet-type",
|
"name": "angular-typed-context-outlet",
|
||||||
"$schema": "../../../node_modules/nx/schemas/project-schema.json",
|
"$schema": "../../../node_modules/nx/schemas/project-schema.json",
|
||||||
"projectType": "application",
|
"projectType": "application",
|
||||||
"sourceRoot": "apps/angular/context-outlet-type/src",
|
"sourceRoot": "apps/angular/4-typed-context-outlet/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/angular/context-outlet-type",
|
"outputPath": "dist/apps/angular/4-typed-context-outlet",
|
||||||
"index": "apps/angular/context-outlet-type/src/index.html",
|
"index": "apps/angular/4-typed-context-outlet/src/index.html",
|
||||||
"main": "apps/angular/context-outlet-type/src/main.ts",
|
"main": "apps/angular/4-typed-context-outlet/src/main.ts",
|
||||||
"polyfills": "apps/angular/context-outlet-type/src/polyfills.ts",
|
"polyfills": "apps/angular/4-typed-context-outlet/src/polyfills.ts",
|
||||||
"tsConfig": "apps/angular/context-outlet-type/tsconfig.app.json",
|
"tsConfig": "apps/angular/4-typed-context-outlet/tsconfig.app.json",
|
||||||
"inlineStyleLanguage": "scss",
|
"inlineStyleLanguage": "scss",
|
||||||
"assets": [
|
"assets": [
|
||||||
"apps/angular/context-outlet-type/src/favicon.ico",
|
"apps/angular/4-typed-context-outlet/src/favicon.ico",
|
||||||
"apps/angular/context-outlet-type/src/assets"
|
"apps/angular/4-typed-context-outlet/src/assets"
|
||||||
],
|
],
|
||||||
"styles": ["apps/angular/context-outlet-type/src/styles.scss"],
|
"styles": ["apps/angular/4-typed-context-outlet/src/styles.scss"],
|
||||||
"scripts": []
|
"scripts": []
|
||||||
},
|
},
|
||||||
"configurations": {
|
"configurations": {
|
||||||
@@ -53,10 +53,10 @@
|
|||||||
"executor": "@angular-devkit/build-angular:dev-server",
|
"executor": "@angular-devkit/build-angular:dev-server",
|
||||||
"configurations": {
|
"configurations": {
|
||||||
"production": {
|
"production": {
|
||||||
"buildTarget": "angular-context-outlet-type:build:production"
|
"buildTarget": "angular-typed-context-outlet:build:production"
|
||||||
},
|
},
|
||||||
"development": {
|
"development": {
|
||||||
"buildTarget": "angular-context-outlet-type:build:development"
|
"buildTarget": "angular-typed-context-outlet:build:development"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"defaultConfiguration": "development"
|
"defaultConfiguration": "development"
|
||||||
@@ -64,7 +64,7 @@
|
|||||||
"extract-i18n": {
|
"extract-i18n": {
|
||||||
"executor": "@angular-devkit/build-angular:extract-i18n",
|
"executor": "@angular-devkit/build-angular:extract-i18n",
|
||||||
"options": {
|
"options": {
|
||||||
"buildTarget": "angular-context-outlet-type:build"
|
"buildTarget": "angular-typed-context-outlet:build"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"lint": {
|
"lint": {
|
||||||
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
@@ -3,24 +3,24 @@
|
|||||||
"$schema": "../../../node_modules/nx/schemas/project-schema.json",
|
"$schema": "../../../node_modules/nx/schemas/project-schema.json",
|
||||||
"projectType": "application",
|
"projectType": "application",
|
||||||
"prefix": "app",
|
"prefix": "app",
|
||||||
"sourceRoot": "apps/angular/view-transition/src",
|
"sourceRoot": "apps/angular/44-view-transition/src",
|
||||||
"tags": [],
|
"tags": [],
|
||||||
"targets": {
|
"targets": {
|
||||||
"build": {
|
"build": {
|
||||||
"executor": "@angular-devkit/build-angular:application",
|
"executor": "@angular-devkit/build-angular:application",
|
||||||
"outputs": ["{options.outputPath}"],
|
"outputs": ["{options.outputPath}"],
|
||||||
"options": {
|
"options": {
|
||||||
"outputPath": "dist/apps/angular/view-transition",
|
"outputPath": "dist/apps/angular/44-view-transition",
|
||||||
"index": "apps/angular/view-transition/src/index.html",
|
"index": "apps/angular/44-view-transition/src/index.html",
|
||||||
"browser": "apps/angular/view-transition/src/main.ts",
|
"browser": "apps/angular/44-view-transition/src/main.ts",
|
||||||
"polyfills": ["zone.js"],
|
"polyfills": ["zone.js"],
|
||||||
"tsConfig": "apps/angular/view-transition/tsconfig.app.json",
|
"tsConfig": "apps/angular/44-view-transition/tsconfig.app.json",
|
||||||
"inlineStyleLanguage": "scss",
|
"inlineStyleLanguage": "scss",
|
||||||
"assets": [
|
"assets": [
|
||||||
"apps/angular/view-transition/src/favicon.ico",
|
"apps/angular/44-view-transition/src/favicon.ico",
|
||||||
"apps/angular/view-transition/src/assets"
|
"apps/angular/44-view-transition/src/assets"
|
||||||
],
|
],
|
||||||
"styles": ["apps/angular/view-transition/src/styles.scss"],
|
"styles": ["apps/angular/44-view-transition/src/styles.scss"],
|
||||||
"scripts": []
|
"scripts": []
|
||||||
},
|
},
|
||||||
"configurations": {
|
"configurations": {
|
||||||
|
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB |
|
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 19 KiB |
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 22 KiB |
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
@@ -1,4 +1,3 @@
|
|||||||
@tailwind base;
|
@tailwind base;
|
||||||
@tailwind components;
|
@tailwind components;
|
||||||
@tailwind utilities;
|
@tailwind utilities;
|
||||||
|
|
||||||
@@ -2,6 +2,7 @@
|
|||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"target": "es2022",
|
"target": "es2022",
|
||||||
"useDefineForClassFields": false,
|
"useDefineForClassFields": false,
|
||||||
|
"esModuleInterop": true,
|
||||||
"forceConsistentCasingInFileNames": true,
|
"forceConsistentCasingInFileNames": true,
|
||||||
"strict": true,
|
"strict": true,
|
||||||
"noImplicitOverride": true,
|
"noImplicitOverride": true,
|
||||||
@@ -3,7 +3,7 @@ export default {
|
|||||||
displayName: 'angular-react-in-angular',
|
displayName: 'angular-react-in-angular',
|
||||||
preset: '../../../jest.preset.js',
|
preset: '../../../jest.preset.js',
|
||||||
setupFilesAfterEnv: ['<rootDir>/src/test-setup.ts'],
|
setupFilesAfterEnv: ['<rootDir>/src/test-setup.ts'],
|
||||||
coverageDirectory: '../../../coverage/apps/angular/react-in-angular',
|
coverageDirectory: '../../../coverage/apps/angular/45-react-in-angular',
|
||||||
transform: {
|
transform: {
|
||||||
'^.+\\.(ts|mjs|js|html)$': [
|
'^.+\\.(ts|mjs|js|html)$': [
|
||||||
'jest-preset-angular',
|
'jest-preset-angular',
|
||||||
@@ -3,24 +3,24 @@
|
|||||||
"$schema": "../../../node_modules/nx/schemas/project-schema.json",
|
"$schema": "../../../node_modules/nx/schemas/project-schema.json",
|
||||||
"projectType": "application",
|
"projectType": "application",
|
||||||
"prefix": "app",
|
"prefix": "app",
|
||||||
"sourceRoot": "apps/angular/react-in-angular/src",
|
"sourceRoot": "apps/angular/45-react-in-angular/src",
|
||||||
"tags": [],
|
"tags": [],
|
||||||
"targets": {
|
"targets": {
|
||||||
"build": {
|
"build": {
|
||||||
"executor": "@angular-devkit/build-angular:application",
|
"executor": "@angular-devkit/build-angular:application",
|
||||||
"outputs": ["{options.outputPath}"],
|
"outputs": ["{options.outputPath}"],
|
||||||
"options": {
|
"options": {
|
||||||
"outputPath": "dist/apps/angular/react-in-angular",
|
"outputPath": "dist/apps/angular/45-react-in-angular",
|
||||||
"index": "apps/angular/react-in-angular/src/index.html",
|
"index": "apps/angular/45-react-in-angular/src/index.html",
|
||||||
"browser": "apps/angular/react-in-angular/src/main.ts",
|
"browser": "apps/angular/45-react-in-angular/src/main.ts",
|
||||||
"polyfills": ["zone.js"],
|
"polyfills": ["zone.js"],
|
||||||
"tsConfig": "apps/angular/react-in-angular/tsconfig.app.json",
|
"tsConfig": "apps/angular/45-react-in-angular/tsconfig.app.json",
|
||||||
"inlineStyleLanguage": "scss",
|
"inlineStyleLanguage": "scss",
|
||||||
"assets": [
|
"assets": [
|
||||||
"apps/angular/react-in-angular/src/favicon.ico",
|
"apps/angular/45-react-in-angular/src/favicon.ico",
|
||||||
"apps/angular/react-in-angular/src/assets"
|
"apps/angular/45-react-in-angular/src/assets"
|
||||||
],
|
],
|
||||||
"styles": ["apps/angular/react-in-angular/src/styles.scss"],
|
"styles": ["apps/angular/45-react-in-angular/src/styles.scss"],
|
||||||
"scripts": []
|
"scripts": []
|
||||||
},
|
},
|
||||||
"configurations": {
|
"configurations": {
|
||||||
@@ -73,7 +73,7 @@
|
|||||||
"executor": "@nx/jest:jest",
|
"executor": "@nx/jest:jest",
|
||||||
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
|
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
|
||||||
"options": {
|
"options": {
|
||||||
"jestConfig": "apps/angular/react-in-angular/jest.config.ts"
|
"jestConfig": "apps/angular/45-react-in-angular/jest.config.ts"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
29
apps/angular/45-react-in-angular/src/app/react/ReactPost.tsx
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
// import React from 'react';
|
||||||
|
|
||||||
|
export default function ReactPost(props: {
|
||||||
|
title?: string;
|
||||||
|
description?: string;
|
||||||
|
pictureLink?: string;
|
||||||
|
selected?: boolean;
|
||||||
|
handleClick: () => void;
|
||||||
|
}) {
|
||||||
|
return (
|
||||||
|
<div className={props.selected ? 'bg-blue-100' : 'bg-white'}>
|
||||||
|
<div className="max-w-sm overflow-hidden rounded shadow-lg">
|
||||||
|
<img
|
||||||
|
className="h-32 w-full object-cover"
|
||||||
|
src={props.pictureLink}
|
||||||
|
alt={props.title}></img>
|
||||||
|
<div className="flex flex-col gap-2 px-6 py-4">
|
||||||
|
<div className="mb-2 text-xl font-bold">{props.title}</div>
|
||||||
|
<p className="text-base text-gray-700">{props.description}</p>
|
||||||
|
<button
|
||||||
|
className="rounded bg-blue-500 px-4 py-2 font-bold text-white hover:bg-blue-700"
|
||||||
|
onClick={props.handleClick}>
|
||||||
|
Select
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
@@ -3,7 +3,7 @@ export default {
|
|||||||
displayName: 'angular-simple-animations',
|
displayName: 'angular-simple-animations',
|
||||||
preset: '../../../jest.preset.js',
|
preset: '../../../jest.preset.js',
|
||||||
setupFilesAfterEnv: ['<rootDir>/src/test-setup.ts'],
|
setupFilesAfterEnv: ['<rootDir>/src/test-setup.ts'],
|
||||||
coverageDirectory: '../../../coverage/apps/angular/simple-animations',
|
coverageDirectory: '../../../coverage/apps/angular/46-simple-animations',
|
||||||
transform: {
|
transform: {
|
||||||
'^.+\\.(ts|mjs|js|html)$': [
|
'^.+\\.(ts|mjs|js|html)$': [
|
||||||
'jest-preset-angular',
|
'jest-preset-angular',
|
||||||
@@ -3,24 +3,24 @@
|
|||||||
"$schema": "../../../node_modules/nx/schemas/project-schema.json",
|
"$schema": "../../../node_modules/nx/schemas/project-schema.json",
|
||||||
"projectType": "application",
|
"projectType": "application",
|
||||||
"prefix": "app",
|
"prefix": "app",
|
||||||
"sourceRoot": "apps/angular/simple-animations/src",
|
"sourceRoot": "apps/angular/46-simple-animations/src",
|
||||||
"tags": [],
|
"tags": [],
|
||||||
"targets": {
|
"targets": {
|
||||||
"build": {
|
"build": {
|
||||||
"executor": "@angular-devkit/build-angular:application",
|
"executor": "@angular-devkit/build-angular:application",
|
||||||
"outputs": ["{options.outputPath}"],
|
"outputs": ["{options.outputPath}"],
|
||||||
"options": {
|
"options": {
|
||||||
"outputPath": "dist/apps/angular/simple-animations",
|
"outputPath": "dist/apps/angular/46-simple-animations",
|
||||||
"index": "apps/angular/simple-animations/src/index.html",
|
"index": "apps/angular/46-simple-animations/src/index.html",
|
||||||
"browser": "apps/angular/simple-animations/src/main.ts",
|
"browser": "apps/angular/46-simple-animations/src/main.ts",
|
||||||
"polyfills": ["zone.js"],
|
"polyfills": ["zone.js"],
|
||||||
"tsConfig": "apps/angular/simple-animations/tsconfig.app.json",
|
"tsConfig": "apps/angular/46-simple-animations/tsconfig.app.json",
|
||||||
"inlineStyleLanguage": "scss",
|
"inlineStyleLanguage": "scss",
|
||||||
"assets": [
|
"assets": [
|
||||||
"apps/angular/simple-animations/src/favicon.ico",
|
"apps/angular/46-simple-animations/src/favicon.ico",
|
||||||
"apps/angular/simple-animations/src/assets"
|
"apps/angular/46-simple-animations/src/assets"
|
||||||
],
|
],
|
||||||
"styles": ["apps/angular/simple-animations/src/styles.scss"],
|
"styles": ["apps/angular/46-simple-animations/src/styles.scss"],
|
||||||
"scripts": []
|
"scripts": []
|
||||||
},
|
},
|
||||||
"configurations": {
|
"configurations": {
|
||||||
@@ -73,7 +73,7 @@
|
|||||||
"executor": "@nx/jest:jest",
|
"executor": "@nx/jest:jest",
|
||||||
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
|
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
|
||||||
"options": {
|
"options": {
|
||||||
"jestConfig": "apps/angular/simple-animations/jest.config.ts"
|
"jestConfig": "apps/angular/46-simple-animations/jest.config.ts"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
33
apps/angular/46-simple-animations/tsconfig.json
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
{
|
||||||
|
"compilerOptions": {
|
||||||
|
"target": "es2022",
|
||||||
|
"useDefineForClassFields": false,
|
||||||
|
"esModuleInterop": true,
|
||||||
|
"forceConsistentCasingInFileNames": true,
|
||||||
|
"strict": true,
|
||||||
|
"noImplicitOverride": true,
|
||||||
|
"noPropertyAccessFromIndexSignature": true,
|
||||||
|
"noImplicitReturns": true,
|
||||||
|
"noFallthroughCasesInSwitch": true
|
||||||
|
},
|
||||||
|
"files": [],
|
||||||
|
"include": [],
|
||||||
|
"references": [
|
||||||
|
{
|
||||||
|
"path": "./tsconfig.app.json"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "./tsconfig.spec.json"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "./tsconfig.editor.json"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"extends": "../../../tsconfig.base.json",
|
||||||
|
"angularCompilerOptions": {
|
||||||
|
"enableI18nLegacyMessageIdFormat": false,
|
||||||
|
"strictInjectionParameters": true,
|
||||||
|
"strictInputAccessModifiers": true,
|
||||||
|
"strictTemplates": true
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
# Master Dependancy Injection
|
|
||||||
|
|
||||||
> author: thomas-laforge
|
|
||||||
|
|
||||||
### Run Application
|
|
||||||
|
|
||||||
```bash
|
|
||||||
npx nx serve angular-di
|
|
||||||
```
|
|
||||||
|
|
||||||
### Documentation and Instruction
|
|
||||||
|
|
||||||
Challenge documentation is [here](https://angular-challenges.vercel.app/challenges/angular/16-di/).
|
|
||||||
@@ -1,75 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "angular-di",
|
|
||||||
"$schema": "../../../node_modules/nx/schemas/project-schema.json",
|
|
||||||
"projectType": "application",
|
|
||||||
"sourceRoot": "apps/angular/di/src",
|
|
||||||
"prefix": "app",
|
|
||||||
"targets": {
|
|
||||||
"build": {
|
|
||||||
"executor": "@angular-devkit/build-angular:browser",
|
|
||||||
"outputs": ["{options.outputPath}"],
|
|
||||||
"options": {
|
|
||||||
"outputPath": "dist/apps/angular/di",
|
|
||||||
"index": "apps/angular/di/src/index.html",
|
|
||||||
"main": "apps/angular/di/src/main.ts",
|
|
||||||
"polyfills": ["zone.js"],
|
|
||||||
"tsConfig": "apps/angular/di/tsconfig.app.json",
|
|
||||||
"inlineStyleLanguage": "scss",
|
|
||||||
"assets": [
|
|
||||||
"apps/angular/di/src/favicon.ico",
|
|
||||||
"apps/angular/di/src/assets"
|
|
||||||
],
|
|
||||||
"styles": ["apps/angular/di/src/styles.scss"],
|
|
||||||
"scripts": []
|
|
||||||
},
|
|
||||||
"configurations": {
|
|
||||||
"production": {
|
|
||||||
"budgets": [
|
|
||||||
{
|
|
||||||
"type": "initial",
|
|
||||||
"maximumWarning": "500kb",
|
|
||||||
"maximumError": "1mb"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "anyComponentStyle",
|
|
||||||
"maximumWarning": "2kb",
|
|
||||||
"maximumError": "4kb"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"outputHashing": "all"
|
|
||||||
},
|
|
||||||
"development": {
|
|
||||||
"buildOptimizer": false,
|
|
||||||
"optimization": false,
|
|
||||||
"vendorChunk": true,
|
|
||||||
"extractLicenses": false,
|
|
||||||
"sourceMap": true,
|
|
||||||
"namedChunks": true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"defaultConfiguration": "production"
|
|
||||||
},
|
|
||||||
"serve": {
|
|
||||||
"executor": "@angular-devkit/build-angular:dev-server",
|
|
||||||
"configurations": {
|
|
||||||
"production": {
|
|
||||||
"buildTarget": "angular-di:build:production"
|
|
||||||
},
|
|
||||||
"development": {
|
|
||||||
"buildTarget": "angular-di:build:development"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"defaultConfiguration": "development"
|
|
||||||
},
|
|
||||||
"extract-i18n": {
|
|
||||||
"executor": "@angular-devkit/build-angular:extract-i18n",
|
|
||||||
"options": {
|
|
||||||
"buildTarget": "angular-di:build"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"lint": {
|
|
||||||
"executor": "@nx/eslint:lint"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"tags": []
|
|
||||||
}
|
|
||||||
@@ -1,27 +0,0 @@
|
|||||||
// import React from 'react';
|
|
||||||
|
|
||||||
export default function ReactPost(props: {
|
|
||||||
title?: string,
|
|
||||||
description?: string,
|
|
||||||
pictureLink?: string,
|
|
||||||
selected?: boolean,
|
|
||||||
handleClick: () => void
|
|
||||||
}) {
|
|
||||||
return (
|
|
||||||
<div className={props.selected ? 'bg-blue-100' : 'bg-white'}>
|
|
||||||
<div className="max-w-sm rounded overflow-hidden shadow-lg">
|
|
||||||
<img className="w-full h-32 object-cover" src={props.pictureLink} alt={props.title}></img>
|
|
||||||
<div className="px-6 py-4 flex flex-col gap-2">
|
|
||||||
<div className="font-bold text-xl mb-2">{props.title}</div>
|
|
||||||
<p className="text-gray-700 text-base">
|
|
||||||
{props.description}
|
|
||||||
</p>
|
|
||||||
<button className="bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded"
|
|
||||||
onClick={props.handleClick}>
|
|
||||||
Select
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,33 +0,0 @@
|
|||||||
{
|
|
||||||
"compilerOptions": {
|
|
||||||
"target": "es2022",
|
|
||||||
"useDefineForClassFields": false,
|
|
||||||
"esModuleInterop": true,
|
|
||||||
"forceConsistentCasingInFileNames": true,
|
|
||||||
"strict": true,
|
|
||||||
"noImplicitOverride": true,
|
|
||||||
"noPropertyAccessFromIndexSignature": true,
|
|
||||||
"noImplicitReturns": true,
|
|
||||||
"noFallthroughCasesInSwitch": true,
|
|
||||||
},
|
|
||||||
"files": [],
|
|
||||||
"include": [],
|
|
||||||
"references": [
|
|
||||||
{
|
|
||||||
"path": "./tsconfig.app.json",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "./tsconfig.spec.json",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "./tsconfig.editor.json",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
"extends": "../../../tsconfig.base.json",
|
|
||||||
"angularCompilerOptions": {
|
|
||||||
"enableI18nLegacyMessageIdFormat": false,
|
|
||||||
"strictInjectionParameters": true,
|
|
||||||
"strictInputAccessModifiers": true,
|
|
||||||
"strictTemplates": true,
|
|
||||||
},
|
|
||||||
}
|
|
||||||