Skip to content

Commit f04d512

Browse files
committed
update to angular 7
1 parent 6559384 commit f04d512

38 files changed

+6697
-5675
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
index.html,1555514767030,a1b1f8728fa78e463f4aed3766dfe30d815869567dc1870cd6cea03a2097d063
2+
favicon.ico,1555514767030,3c8f1dca744007357393e9228949f1d36e0865c21c06cb504be0fa21e397df5f
3+
3rdpartylicenses.txt,1555514767029,cff03a7c9a125b09da200adc77ed8df2d176bb7f71f3b9afe72b19552ab6c6a4
4+
runtime.26209474bfa8dc87a77c.js,1555514767029,52d4a5aadcedd90b5828211d17e6ec3110bac1d8d48a7e82f58b7fa8b25b5f0d
5+
polyfills.8bbb231b43165d65d357.js,1555514767030,45a04c7445707e98f5fabc690ed532fc3285d15496495ccf8f2cb4ffcdcd9014
6+
es2015-polyfills.c5dd28b362270c767b34.js,1555514767029,0da6ba47e82051120ed73ccd2d15c79a68e29ea675de283faf9cc4ad312c283a
7+
styles.f8a7f6a5d59f4fc2dcf2.css,1555514767030,3c53b6eac53afcdd4018055eab58a5f5baaf6f6b90f2994f97afae73c305f1f0
8+
main.3dc7f892a48da317bfe9.js,1555514767029,bdf5eed25c4fbe673f13d6e459eb00d8e971523e54633f0804d4647d83dbcb4d

.firebaserc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"projects": {
3+
"tutorial": "angular-forms-and-validations"
4+
}
5+
}

README.md

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,31 @@
11
# Angular Forms and Validations
22

3-
This project is part of an Angular tutorial about forms and validations.
3+
This project is part of an Angular 7 tutorial about forms and validations.
44

55
Get the step by step free tutorial in https://angular-templates.io/tutorials/about/angular-forms-and-validations
66

7-
Please support this project by simply putting a Github star ⭐. Share this library with friends on Twitter and everywhere else you can. 🙏. Thanks
8-
7+
**Please support this project by simply putting a Github star ⭐. 🙏 Thanks**
98

109
## Installation
10+
1111
Run `npm install` to install all the required dependencies
1212

13-
Then run `ng serve` to start a dev server. Navigate to http://localhost:4200/. The app will automatically reload if you change any of the source files.
13+
Then run `ng serve` to start a dev server.
14+
Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.
1415

1516
![](https://s3-us-west-2.amazonaws.com/angular-templates/tutorials/angular-forms-and-validations/angular-forms-and-validations-3.png)
17+
18+
19+
## Online Demo
20+
21+
You can try the online demo of this Angular 7 CRUD [here](https://angular-forms-and-validations.firebaseapp.com/).
22+
23+
## Premium Angular Starter Apps
24+
25+
If you want to build a complex and robust app with Angular Forms and Validations you should check [Angular Admin Template](https://angular-templates.com/product/angular-admin-template) which is a super complete application to build your next angular project.
26+
27+
Created with performance and ease of development in mind, this Angular 7 web template is something you will love. It includes all the components that you might need inside a project and a detailed documentation on how to get started.
28+
![](https://s3-us-west-2.amazonaws.com/angular-templates/angular-duo-template/angular-admin-template-new-cover.jpeg)
29+
30+
## Free Angular examples
31+
Find more Angular tutorials and starter apps in https://angular-templates.com

angular-cli.json

Lines changed: 0 additions & 50 deletions
This file was deleted.
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1">
6+
<title>Welcome to Firebase Hosting</title>
7+
8+
<!-- update the version number as needed -->
9+
<script defer src="/__/firebase/5.9.4/firebase-app.js"></script>
10+
<!-- include only the Firebase features as you need -->
11+
<script defer src="/__/firebase/5.9.4/firebase-auth.js"></script>
12+
<script defer src="/__/firebase/5.9.4/firebase-database.js"></script>
13+
<script defer src="/__/firebase/5.9.4/firebase-messaging.js"></script>
14+
<script defer src="/__/firebase/5.9.4/firebase-storage.js"></script>
15+
<!-- initialize the SDK after all desired features are loaded -->
16+
<script defer src="/__/firebase/init.js"></script>
17+
18+
<style media="screen">
19+
body { background: #ECEFF1; color: rgba(0,0,0,0.87); font-family: Roboto, Helvetica, Arial, sans-serif; margin: 0; padding: 0; }
20+
#message { background: white; max-width: 360px; margin: 100px auto 16px; padding: 32px 24px; border-radius: 3px; }
21+
#message h2 { color: #ffa100; font-weight: bold; font-size: 16px; margin: 0 0 8px; }
22+
#message h1 { font-size: 22px; font-weight: 300; color: rgba(0,0,0,0.6); margin: 0 0 16px;}
23+
#message p { line-height: 140%; margin: 16px 0 24px; font-size: 14px; }
24+
#message a { display: block; text-align: center; background: #039be5; text-transform: uppercase; text-decoration: none; color: white; padding: 16px; border-radius: 4px; }
25+
#message, #message a { box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24); }
26+
#load { color: rgba(0,0,0,0.4); text-align: center; font-size: 13px; }
27+
@media (max-width: 600px) {
28+
body, #message { margin-top: 0; background: white; box-shadow: none; }
29+
body { border-top: 16px solid #ffa100; }
30+
}
31+
</style>
32+
</head>
33+
<body>
34+
<div id="message">
35+
<h2>Welcome</h2>
36+
<h1>Firebase Hosting Setup Complete</h1>
37+
<p>You're seeing this because you've successfully setup Firebase Hosting. Now it's time to go build something extraordinary!</p>
38+
<a target="_blank" href="https://firebase.google.com/docs/hosting/">Open Hosting Documentation</a>
39+
</div>
40+
<p id="load">Firebase SDK Loading&hellip;</p>
41+
42+
<script>
43+
document.addEventListener('DOMContentLoaded', function() {
44+
// // 🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥
45+
// // The Firebase SDK is initialized and available here!
46+
//
47+
// firebase.auth().onAuthStateChanged(user => { });
48+
// firebase.database().ref('/path/to/ref').on('value', snapshot => { });
49+
// firebase.messaging().requestPermission().then(() => { });
50+
// firebase.storage().ref('/path/to/ref').getDownloadURL().then(() => { });
51+
//
52+
// // 🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥
53+
54+
try {
55+
let app = firebase.app();
56+
let features = ['auth', 'database', 'messaging', 'storage'].filter(feature => typeof app[feature] === 'function');
57+
document.getElementById('load').innerHTML = `Firebase SDK loaded with ${features.join(', ')}`;
58+
} catch (e) {
59+
console.error(e);
60+
document.getElementById('load').innerHTML = 'Error loading the Firebase SDK, check the console.';
61+
}
62+
});
63+
</script>
64+
</body>
65+
</html>

angular.json

Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
{
2+
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
3+
"version": 1,
4+
"newProjectRoot": "projects",
5+
"projects": {
6+
"angular-forms-and-validations": {
7+
"root": "",
8+
"sourceRoot": "src",
9+
"projectType": "application",
10+
"prefix": "app",
11+
"schematics": {
12+
"@schematics/angular:component": {
13+
"style": "scss"
14+
}
15+
},
16+
"architect": {
17+
"build": {
18+
"builder": "@angular-devkit/build-angular:browser",
19+
"options": {
20+
"outputPath": "dist/angular-forms-and-validations",
21+
"index": "src/index.html",
22+
"main": "src/main.ts",
23+
"polyfills": "src/polyfills.ts",
24+
"tsConfig": "src/tsconfig.app.json",
25+
"assets": [
26+
"src/favicon.ico",
27+
"src/assets"
28+
],
29+
"styles": [
30+
"./node_modules/@angular/material/prebuilt-themes/indigo-pink.css",
31+
"src/styles.scss"
32+
],
33+
"scripts": [],
34+
"es5BrowserSupport": true
35+
},
36+
"configurations": {
37+
"production": {
38+
"fileReplacements": [
39+
{
40+
"replace": "src/environments/environment.ts",
41+
"with": "src/environments/environment.prod.ts"
42+
}
43+
],
44+
"optimization": true,
45+
"outputHashing": "all",
46+
"sourceMap": false,
47+
"extractCss": true,
48+
"namedChunks": false,
49+
"aot": true,
50+
"extractLicenses": true,
51+
"vendorChunk": false,
52+
"buildOptimizer": true,
53+
"budgets": [
54+
{
55+
"type": "initial",
56+
"maximumWarning": "2mb",
57+
"maximumError": "5mb"
58+
}
59+
]
60+
}
61+
}
62+
},
63+
"serve": {
64+
"builder": "@angular-devkit/build-angular:dev-server",
65+
"options": {
66+
"browserTarget": "angular-forms-and-validations:build"
67+
},
68+
"configurations": {
69+
"production": {
70+
"browserTarget": "angular-forms-and-validations:build:production"
71+
}
72+
}
73+
},
74+
"extract-i18n": {
75+
"builder": "@angular-devkit/build-angular:extract-i18n",
76+
"options": {
77+
"browserTarget": "angular-forms-and-validations:build"
78+
}
79+
},
80+
"test": {
81+
"builder": "@angular-devkit/build-angular:karma",
82+
"options": {
83+
"main": "src/test.ts",
84+
"polyfills": "src/polyfills.ts",
85+
"tsConfig": "src/tsconfig.spec.json",
86+
"karmaConfig": "src/karma.conf.js",
87+
"styles": [
88+
"./node_modules/@angular/material/prebuilt-themes/indigo-pink.css",
89+
"src/styles.scss"
90+
],
91+
"scripts": [],
92+
"assets": [
93+
"src/favicon.ico",
94+
"src/assets"
95+
]
96+
}
97+
},
98+
"lint": {
99+
"builder": "@angular-devkit/build-angular:tslint",
100+
"options": {
101+
"tsConfig": [
102+
"src/tsconfig.app.json",
103+
"src/tsconfig.spec.json"
104+
],
105+
"exclude": [
106+
"**/node_modules/**"
107+
]
108+
}
109+
}
110+
}
111+
},
112+
"angular-forms-and-validations-e2e": {
113+
"root": "e2e/",
114+
"projectType": "application",
115+
"prefix": "",
116+
"architect": {
117+
"e2e": {
118+
"builder": "@angular-devkit/build-angular:protractor",
119+
"options": {
120+
"protractorConfig": "e2e/protractor.conf.js",
121+
"devServerTarget": "angular-forms-and-validations:serve"
122+
},
123+
"configurations": {
124+
"production": {
125+
"devServerTarget": "angular-forms-and-validations:serve:production"
126+
}
127+
}
128+
},
129+
"lint": {
130+
"builder": "@angular-devkit/build-angular:tslint",
131+
"options": {
132+
"tsConfig": "e2e/tsconfig.e2e.json",
133+
"exclude": [
134+
"**/node_modules/**"
135+
]
136+
}
137+
}
138+
}
139+
}
140+
},
141+
"defaultProject": "angular-forms-and-validations"
142+
}

e2e/src/app.e2e-spec.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import { AppPage } from './app.po';
2+
import { browser, logging } from 'protractor';
3+
4+
describe('workspace-project App', () => {
5+
let page: AppPage;
6+
7+
beforeEach(() => {
8+
page = new AppPage();
9+
});
10+
11+
it('should display welcome message', () => {
12+
page.navigateTo();
13+
expect(page.getTitleText()).toEqual('Welcome to angular-forms-and-validations!');
14+
});
15+
16+
afterEach(async () => {
17+
// Assert that there are no errors emitted from the browser
18+
const logs = await browser.manage().logs().get(logging.Type.BROWSER);
19+
expect(logs).not.toContain(jasmine.objectContaining({
20+
level: logging.Level.SEVERE,
21+
} as logging.Entry));
22+
});
23+
});

e2e/src/app.po.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { browser, by, element } from 'protractor';
2+
3+
export class AppPage {
4+
navigateTo() {
5+
return browser.get(browser.baseUrl) as Promise<any>;
6+
}
7+
8+
getTitleText() {
9+
return element(by.css('app-root h1')).getText() as Promise<string>;
10+
}
11+
}

e2e/tsconfig.e2e.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"extends": "../tsconfig.json",
3+
"compilerOptions": {
4+
"outDir": "../out-tsc/app",
5+
"module": "commonjs",
6+
"target": "es5",
7+
"types": [
8+
"jasmine",
9+
"jasminewd2",
10+
"node"
11+
]
12+
}
13+
}

firebase.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"hosting": {
3+
"public": "dist/angular-forms-and-validations",
4+
"ignore": [
5+
"firebase.json",
6+
"**/.*",
7+
"**/node_modules/**"
8+
],
9+
"rewrites": [
10+
{
11+
"source": "**",
12+
"destination": "/index.html"
13+
}
14+
]
15+
}
16+
}

0 commit comments

Comments
 (0)