Skip to content

Commit 2d6dcf3

Browse files
committed
feat: add challenge 49
1 parent 5413b9e commit 2d6dcf3

28 files changed

+363
-19
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ If you would like to propose a challenge, this project is open source, so feel f
2424
2525
## Challenges
2626

27-
Check [all 47 challenges](https://angular-challenges.vercel.app/)
27+
Check [all 49 challenges](https://angular-challenges.vercel.app/)
2828

2929
## Contributors ✨
3030

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"extends": ["../../../.eslintrc.json"],
3+
"ignorePatterns": ["!**/*"],
4+
"overrides": [
5+
{
6+
"files": ["*.ts"],
7+
"extends": [
8+
"plugin:@nx/angular",
9+
"plugin:@angular-eslint/template/process-inline-templates"
10+
],
11+
"rules": {
12+
"@angular-eslint/directive-selector": [
13+
"error",
14+
{
15+
"type": "attribute",
16+
"prefix": "app",
17+
"style": "camelCase"
18+
}
19+
],
20+
"@angular-eslint/component-selector": [
21+
"error",
22+
{
23+
"type": "element",
24+
"prefix": "app",
25+
"style": "kebab-case"
26+
}
27+
]
28+
}
29+
},
30+
{
31+
"files": ["*.html"],
32+
"extends": ["plugin:@nx/angular-template"],
33+
"rules": {}
34+
}
35+
]
36+
}

apps/rxjs/hold-to-save-btn/README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Hold to send button
2+
3+
> author: thomas-laforge
4+
5+
### Run Application
6+
7+
```bash
8+
npx nx serve rxjs-hold-to-save-btn
9+
```
10+
11+
### Documentation and Instruction
12+
13+
Challenge documentation is [here](https://angular-challenges.vercel.app/challenges/rxjs/49-hold-to-save-btn/).
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/* eslint-disable */
2+
export default {
3+
displayName: 'rxjs-hold-to-save-btn',
4+
preset: '../../../jest.preset.js',
5+
setupFilesAfterEnv: ['<rootDir>/src/test-setup.ts'],
6+
coverageDirectory: '../../../coverage/apps/rxjs/hold-to-save-btn',
7+
transform: {
8+
'^.+\\.(ts|mjs|js|html)$': [
9+
'jest-preset-angular',
10+
{
11+
tsconfig: '<rootDir>/tsconfig.spec.json',
12+
stringifyContentPathRegex: '\\.(html|svg)$',
13+
},
14+
],
15+
},
16+
transformIgnorePatterns: ['node_modules/(?!.*\\.mjs$)'],
17+
snapshotSerializers: [
18+
'jest-preset-angular/build/serializers/no-ng-attributes',
19+
'jest-preset-angular/build/serializers/ng-snapshot',
20+
'jest-preset-angular/build/serializers/html-comment',
21+
],
22+
};
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
{
2+
"name": "rxjs-hold-to-save-btn",
3+
"$schema": "../../../node_modules/nx/schemas/project-schema.json",
4+
"projectType": "application",
5+
"prefix": "app",
6+
"sourceRoot": "apps/rxjs/hold-to-save-btn/src",
7+
"tags": [],
8+
"targets": {
9+
"build": {
10+
"executor": "@angular-devkit/build-angular:application",
11+
"outputs": ["{options.outputPath}"],
12+
"options": {
13+
"outputPath": "dist/apps/rxjs/hold-to-save-btn",
14+
"index": "apps/rxjs/hold-to-save-btn/src/index.html",
15+
"browser": "apps/rxjs/hold-to-save-btn/src/main.ts",
16+
"polyfills": ["zone.js"],
17+
"tsConfig": "apps/rxjs/hold-to-save-btn/tsconfig.app.json",
18+
"inlineStyleLanguage": "scss",
19+
"assets": [
20+
"apps/rxjs/hold-to-save-btn/src/favicon.ico",
21+
"apps/rxjs/hold-to-save-btn/src/assets"
22+
],
23+
"styles": ["apps/rxjs/hold-to-save-btn/src/styles.scss"],
24+
"scripts": []
25+
},
26+
"configurations": {
27+
"production": {
28+
"budgets": [
29+
{
30+
"type": "initial",
31+
"maximumWarning": "500kb",
32+
"maximumError": "1mb"
33+
},
34+
{
35+
"type": "anyComponentStyle",
36+
"maximumWarning": "2kb",
37+
"maximumError": "4kb"
38+
}
39+
],
40+
"outputHashing": "all"
41+
},
42+
"development": {
43+
"optimization": false,
44+
"extractLicenses": false,
45+
"sourceMap": true
46+
}
47+
},
48+
"defaultConfiguration": "production"
49+
},
50+
"serve": {
51+
"executor": "@angular-devkit/build-angular:dev-server",
52+
"configurations": {
53+
"production": {
54+
"buildTarget": "rxjs-hold-to-save-btn:build:production"
55+
},
56+
"development": {
57+
"buildTarget": "rxjs-hold-to-save-btn:build:development"
58+
}
59+
},
60+
"defaultConfiguration": "development"
61+
},
62+
"extract-i18n": {
63+
"executor": "@angular-devkit/build-angular:extract-i18n",
64+
"options": {
65+
"buildTarget": "rxjs-hold-to-save-btn:build"
66+
}
67+
},
68+
"lint": {
69+
"executor": "@nx/eslint:lint"
70+
},
71+
"test": {
72+
"executor": "@nx/jest:jest",
73+
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
74+
"options": {
75+
"jestConfig": "apps/rxjs/hold-to-save-btn/jest.config.ts"
76+
}
77+
}
78+
}
79+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import { ChangeDetectionStrategy, Component } from '@angular/core';
2+
3+
@Component({
4+
standalone: true,
5+
imports: [],
6+
selector: 'app-root',
7+
template: `
8+
<main class="flex h-screen items-center justify-center">
9+
<div
10+
class="flex w-full max-w-screen-sm flex-col items-center gap-y-8 p-4">
11+
<button
12+
class="rounded bg-indigo-600 px-4 py-2 font-bold text-white transition-colors ease-in-out hover:bg-indigo-700">
13+
Hold me
14+
</button>
15+
16+
<progress [value]="20" [max]="100"></progress>
17+
</div>
18+
</main>
19+
`,
20+
changeDetection: ChangeDetectionStrategy.OnPush,
21+
})
22+
export class AppComponent {
23+
onSend() {
24+
console.log('Save it!');
25+
}
26+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { ApplicationConfig } from '@angular/core';
2+
3+
export const appConfig: ApplicationConfig = {
4+
providers: [],
5+
};

apps/rxjs/hold-to-save-btn/src/assets/.gitkeep

Whitespace-only changes.
14.7 KB
Binary file not shown.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8" />
5+
<title>rxjs-hold-to-save-btn</title>
6+
<base href="/" />
7+
<meta name="viewport" content="width=device-width, initial-scale=1" />
8+
<link rel="icon" type="image/x-icon" href="favicon.ico" />
9+
</head>
10+
<body>
11+
<app-root></app-root>
12+
</body>
13+
</html>

0 commit comments

Comments
 (0)