├── .editorconfig
├── .gitignore
├── README.md
├── TODO.md
├── angular.json
├── data
├── healthyMeData-original.json
├── healthyMeData.json
└── routes.json
├── e2e
├── protractor.conf.js
├── src
│ ├── app.e2e-spec.ts
│ └── app.po.ts
└── tsconfig.e2e.json
├── files
├── template.community.component.html.txt
├── template.confirm-modal.component.html.txt
├── template.entry-details.component.html.txt
├── template.login.component.html.txt
├── template.new-weight-entry.component.html.txt
└── template.weight-entries.service.ts.txt
├── package-lock.json
├── package.json
├── proxy.conf.json
├── src
├── app
│ ├── app.component.css
│ ├── app.component.html
│ ├── app.component.ts
│ └── app.module.ts
├── assets
│ ├── .gitkeep
│ ├── sb-admin.min.css
│ └── sb-admin.min.js
├── browserslist
├── environments
│ ├── environment.prod.ts
│ └── environment.ts
├── favicon.ico
├── index.html
├── karma.conf.js
├── main.ts
├── polyfills.ts
├── styles.css
├── test.ts
├── tsconfig.app.json
├── tsconfig.spec.json
└── tslint.json
├── tsconfig.json
└── tslint.json
/.editorconfig:
--------------------------------------------------------------------------------
1 | # Editor configuration, see http://editorconfig.org
2 | root = true
3 |
4 | [*]
5 | charset = utf-8
6 | indent_style = space
7 | indent_size = 2
8 | insert_final_newline = true
9 | trim_trailing_whitespace = true
10 |
11 | [*.md]
12 | max_line_length = off
13 | trim_trailing_whitespace = false
14 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # See http://help.github.com/ignore-files/ for more about ignoring files.
2 |
3 | # compiled output
4 | /dist
5 | /tmp
6 | /out-tsc
7 |
8 | # dependencies
9 | /node_modules
10 |
11 | # IDEs and editors
12 | /.idea
13 | .project
14 | .classpath
15 | .c9/
16 | *.launch
17 | .settings/
18 | *.sublime-workspace
19 |
20 | # IDE - VSCode
21 | .vscode/*
22 | !.vscode/settings.json
23 | !.vscode/tasks.json
24 | !.vscode/launch.json
25 | !.vscode/extensions.json
26 |
27 | # misc
28 | /.sass-cache
29 | /connect.lock
30 | /coverage
31 | /libpeerconnection.log
32 | npm-debug.log
33 | yarn-error.log
34 | testem.log
35 | /typings
36 |
37 | # System Files
38 | .DS_Store
39 | Thumbs.db
40 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Plualsight's Angular Crash Course
2 |
3 | Enter new weight on page, default to current date
4 | Highlight if they put in a past date
5 | XX Don’t allow future dates
6 | Settings page
7 | Overview on home page - trend or something? Last 3 entries?
8 |
9 | Add some kind of goal setting?
10 | A setting to turn on body fat or BMI tracking. It’s all hidden if not
11 | Settings for pounds or kilos
12 | Setting to create a workout??
13 | Workout tracking
14 | Calorie tracking
15 | Body fat % tracking
16 | BMI tracking
17 | Need some kind of content projection - popup? Maybe a common Tip component
18 | Http - https://github.com/typicode/json-server
19 |
20 | Finish demo
21 | Break down demo into outline
22 |
--------------------------------------------------------------------------------
/TODO.md:
--------------------------------------------------------------------------------
1 | Demo:
2 | Enter new weight on page, default to current date
3 | Highlight if they put in a past date
4 | Don’t allow future dates
5 | Settings page
6 | Overview on home page - trend or something? Last 3 entries?
7 |
8 | Add some kind of goal setting?
9 | A setting to turn on body fat or BMI tracking. It’s all hidden if not
10 | Settings for pounds or kilos
11 | Setting to create a workout??
12 | Workout tracking
13 | Calorie tracking
14 | Body fat % tracking
15 | BMI tracking
16 | Need some kind of content projection - popup? Maybe a common Tip component
17 | Http - https://github.com/typicode/json-server
18 |
19 | Finish demo
20 | Break down demo into outline
21 |
--------------------------------------------------------------------------------
/angular.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
3 | "version": 1,
4 | "newProjectRoot": "projects",
5 | "projects": {
6 | "healthy-me": {
7 | "root": "",
8 | "sourceRoot": "src",
9 | "projectType": "application",
10 | "prefix": "hm",
11 | "schematics": {},
12 | "architect": {
13 | "build": {
14 | "builder": "@angular-devkit/build-angular:browser",
15 | "options": {
16 | "outputPath": "dist/healthy-me",
17 | "index": "src/index.html",
18 | "main": "src/main.ts",
19 | "polyfills": "src/polyfills.ts",
20 | "tsConfig": "src/tsconfig.app.json",
21 | "assets": [
22 | "src/favicon.ico",
23 | "src/assets"
24 | ],
25 | "styles": [
26 | "node_modules/bootstrap/dist/css/bootstrap.min.css",
27 | "src/assets/sb-admin.min.css",
28 | "node_modules/@fortawesome/fontawesome-free/css/all.min.css",
29 | "src/styles.css"
30 | ],
31 | "scripts": [
32 | "node_modules/jquery/dist/jquery.min.js",
33 | "node_modules/bootstrap/dist/js/bootstrap.min.js",
34 | "src/assets/sb-admin.min.js"
35 | ]
36 | },
37 | "configurations": {
38 | "production": {
39 | "fileReplacements": [
40 | {
41 | "replace": "src/environments/environment.ts",
42 | "with": "src/environments/environment.prod.ts"
43 | }
44 | ],
45 | "optimization": true,
46 | "outputHashing": "all",
47 | "sourceMap": false,
48 | "extractCss": true,
49 | "namedChunks": false,
50 | "aot": true,
51 | "extractLicenses": true,
52 | "vendorChunk": false,
53 | "buildOptimizer": true
54 | }
55 | }
56 | },
57 | "serve": {
58 | "builder": "@angular-devkit/build-angular:dev-server",
59 | "options": {
60 | "browserTarget": "healthy-me:build"
61 | },
62 | "configurations": {
63 | "production": {
64 | "browserTarget": "healthy-me:build:production"
65 | }
66 | }
67 | },
68 | "extract-i18n": {
69 | "builder": "@angular-devkit/build-angular:extract-i18n",
70 | "options": {
71 | "browserTarget": "healthy-me:build"
72 | }
73 | },
74 | "test": {
75 | "builder": "@angular-devkit/build-angular:karma",
76 | "options": {
77 | "main": "src/test.ts",
78 | "polyfills": "src/polyfills.ts",
79 | "tsConfig": "src/tsconfig.spec.json",
80 | "karmaConfig": "src/karma.conf.js",
81 | "styles": [
82 | "src/styles.css"
83 | ],
84 | "scripts": [],
85 | "assets": [
86 | "src/favicon.ico",
87 | "src/assets"
88 | ]
89 | }
90 | },
91 | "lint": {
92 | "builder": "@angular-devkit/build-angular:tslint",
93 | "options": {
94 | "tsConfig": [
95 | "src/tsconfig.app.json",
96 | "src/tsconfig.spec.json"
97 | ],
98 | "exclude": [
99 | "**/node_modules/**"
100 | ]
101 | }
102 | }
103 | }
104 | },
105 | "healthy-me-e2e": {
106 | "root": "e2e/",
107 | "projectType": "application",
108 | "architect": {
109 | "e2e": {
110 | "builder": "@angular-devkit/build-angular:protractor",
111 | "options": {
112 | "protractorConfig": "e2e/protractor.conf.js",
113 | "devServerTarget": "healthy-me:serve"
114 | },
115 | "configurations": {
116 | "production": {
117 | "devServerTarget": "healthy-me:serve:production"
118 | }
119 | }
120 | },
121 | "lint": {
122 | "builder": "@angular-devkit/build-angular:tslint",
123 | "options": {
124 | "tsConfig": "e2e/tsconfig.e2e.json",
125 | "exclude": [
126 | "**/node_modules/**"
127 | ]
128 | }
129 | }
130 | }
131 | }
132 | },
133 | "defaultProject": "healthy-me"
134 | }
--------------------------------------------------------------------------------
/data/healthyMeData-original.json:
--------------------------------------------------------------------------------
1 | {
2 | "entries": [
3 | {"id":1,"date":"1996-01-01T07:00:00.000Z","weight":165,"bodyfat":0.20},
4 | {"id":2,"date":"1996-01-02T07:00:00.000Z","weight":164,"bodyfat":0.19},
5 | {"id":3,"date":"1996-01-03T07:00:00.000Z","weight":164,"bodyfat":0.19},
6 | {"id":4,"date":"1996-01-12T07:00:00.000Z","weight":161,"bodyfat":0.18},
7 | {"id":5,"date":"1995-12-31T07:00:00.000Z","weight":167,"bodyfat":0.20},
8 | {"id":6,"date":"1995-12-01T07:00:00.000Z","weight":161,"bodyfat":0.18}
9 | ],
10 | "settings": {
11 | "trackBodyFat": true
12 | },
13 | "comments": [
14 | {
15 | "commenter": "Bob",
16 | "comment": "Great job!!"
17 | },
18 | {
19 | "commenter": "Alex",
20 | "comment": "Your progress is inspiring!"
21 | },
22 | {
23 | "commenter": "Sherry",
24 | "comment": "Way to go so far!"
25 | },
26 | {
27 | "commenter": "Nicole",
28 | "comment": "Keep it up!"
29 | },
30 | {
31 | "commenter": "John",
32 | "comment": "How is the diet going?"
33 | }
34 | ]
35 | }
--------------------------------------------------------------------------------
/data/healthyMeData.json:
--------------------------------------------------------------------------------
1 | {
2 | "entries": [
3 | {
4 | "id": 1,
5 | "date": "1996-01-01T07:00:00.000Z",
6 | "weight": 165,
7 | "bodyfat": 0.2
8 | },
9 | {
10 | "id": 2,
11 | "date": "1996-01-02T07:00:00.000Z",
12 | "weight": 164,
13 | "bodyfat": 0.19
14 | },
15 | {
16 | "id": 3,
17 | "date": "1996-01-03T07:00:00.000Z",
18 | "weight": 164,
19 | "bodyfat": 0.19
20 | },
21 | {
22 | "id": 4,
23 | "date": "1996-01-12T07:00:00.000Z",
24 | "weight": 161,
25 | "bodyfat": 0.18
26 | },
27 | {
28 | "id": 5,
29 | "date": "1995-12-31T07:00:00.000Z",
30 | "weight": 167,
31 | "bodyfat": 0.2
32 | },
33 | {
34 | "id": 6,
35 | "date": "1995-12-01T07:00:00.000Z",
36 | "weight": 161,
37 | "bodyfat": 0.18
38 | }
39 | ],
40 | "settings": {
41 | "trackBodyFat": false
42 | },
43 | "comments": [
44 | {
45 | "id": 0,
46 | "commenter": "Bob",
47 | "comment": "Great job!!"
48 | },
49 | {
50 | "id": 1,
51 | "commenter": "Alex",
52 | "comment": "Your progress is inspiring!"
53 | },
54 | {
55 | "id": 2,
56 | "commenter": "Sherry",
57 | "comment": "Way to go so far!"
58 | },
59 | {
60 | "id": 3,
61 | "commenter": "Nicole",
62 | "comment": "Keep it up!"
63 | },
64 | {
65 | "id": 4,
66 | "commenter": "John",
67 | "comment": "How is the diet going?"
68 | }
69 | ]
70 | }
--------------------------------------------------------------------------------
/data/routes.json:
--------------------------------------------------------------------------------
1 | {
2 | "/api/*": "/$1"
3 | }
--------------------------------------------------------------------------------
/e2e/protractor.conf.js:
--------------------------------------------------------------------------------
1 | // Protractor configuration file, see link for more information
2 | // https://github.com/angular/protractor/blob/master/lib/config.ts
3 |
4 | const { SpecReporter } = require('jasmine-spec-reporter');
5 |
6 | exports.config = {
7 | allScriptsTimeout: 11000,
8 | specs: [
9 | './src/**/*.e2e-spec.ts'
10 | ],
11 | capabilities: {
12 | 'browserName': 'chrome'
13 | },
14 | directConnect: true,
15 | baseUrl: 'http://localhost:4200/',
16 | framework: 'jasmine',
17 | jasmineNodeOpts: {
18 | showColors: true,
19 | defaultTimeoutInterval: 30000,
20 | print: function() {}
21 | },
22 | onPrepare() {
23 | require('ts-node').register({
24 | project: require('path').join(__dirname, './tsconfig.e2e.json')
25 | });
26 | jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } }));
27 | }
28 | };
--------------------------------------------------------------------------------
/e2e/src/app.e2e-spec.ts:
--------------------------------------------------------------------------------
1 | import { AppPage } from './app.po';
2 |
3 | describe('workspace-project App', () => {
4 | let page: AppPage;
5 |
6 | beforeEach(() => {
7 | page = new AppPage();
8 | });
9 |
10 | it('should display welcome message', () => {
11 | page.navigateTo();
12 | expect(page.getParagraphText()).toEqual('Welcome to healthy me!');
13 | });
14 | });
15 |
--------------------------------------------------------------------------------
/e2e/src/app.po.ts:
--------------------------------------------------------------------------------
1 | import { browser, by, element } from 'protractor';
2 |
3 | export class AppPage {
4 | navigateTo() {
5 | return browser.get('/');
6 | }
7 |
8 | getParagraphText() {
9 | return element(by.css('hm-root h1')).getText();
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/e2e/tsconfig.e2e.json:
--------------------------------------------------------------------------------
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 | }
--------------------------------------------------------------------------------
/files/template.community.component.html.txt:
--------------------------------------------------------------------------------
1 |
2 |
Healthy Me Community
3 |
Comments
4 |
Bob said: Great job!!"
5 |
Alex said: Your progress is inspiring!"
6 |
Sherry said: Way to go so far!"
7 |
Nicole said: Keep it up!"
8 |
John said: How is the diet going?"
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/files/template.confirm-modal.component.html.txt:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
12 |
13 |
14 |
15 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/files/template.entry-details.component.html.txt:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 | Weight: {{ entry?.weight }}
8 |
9 |
10 | Body Fat: {{ entry?.bodyfat | percent }}
11 |
12 |
13 |
--------------------------------------------------------------------------------
/files/template.login.component.html.txt:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
14 |
15 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/files/template.new-weight-entry.component.html.txt:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/files/template.weight-entries.service.ts.txt:
--------------------------------------------------------------------------------
1 | import { Injectable } from "@angular/core";
2 | import { Entry } from "./model/entry";
3 |
4 | @Injectable({
5 | providedIn: 'root'
6 | })
7 | export class WeightEntriesService {
8 | public entriesArray: Entry[] = [
9 | {id:1,date:new Date('1/1/1996'),weight:165,bodyfat:.20},
10 | {id:2,date:new Date('1/2/1996'),weight:164,bodyfat:.19},
11 | {id:3,date:new Date('1/3/1996'),weight:164,bodyfat:.19},
12 | {id:4,date:new Date('1/12/1996'),weight:161,bodyfat:.18},
13 | {id:5,date:new Date('12/31/1995'),weight:167,bodyfat:.20},
14 | {id:6,date:new Date('12/1/1995'),weight:161,bodyfat:.18},
15 | ]
16 |
17 | public sortedEntries: Entry[];
18 |
19 | constructor() {
20 | }
21 |
22 | private sortEntries() {
23 | this.sortedEntries = [...this.entriesArray].sort((a:Entry, b:Entry) => {
24 | if(a.date > b.date) {
25 | return 1;
26 | } else if (a.date.getTime() == b.date.getTime()) {
27 | return 0;
28 | } else {
29 | return -1
30 | }
31 | })
32 | }
33 |
34 | addEntry(entry: Entry) {
35 | entry.id = getMaxId(this.entriesArray) + 1;
36 | this.entriesArray = [...this.entriesArray, { ...entry}];
37 | this.sortEntries();
38 | }
39 |
40 | }
41 |
42 | function getMaxId(data) {
43 | return data.reduce((p, c) => {
44 | return Math.max(p, c.id);
45 | },0)
46 | }
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "healthy-me",
3 | "version": "0.0.0",
4 | "scripts": {
5 | "ng": "ng",
6 | "start": "ng serve --proxy-config proxy.conf.json",
7 | "build": "ng build --prod",
8 | "test": "ng test",
9 | "lint": "ng lint",
10 | "server": "json-server --routes data/routes.json --watch data/healthyMeData.json",
11 | "e2e": "ng e2e"
12 | },
13 | "private": true,
14 | "dependencies": {
15 | "@angular/animations": "7.0.0-rc.0",
16 | "@angular/common": "7.0.0-rc.0",
17 | "@angular/compiler": "7.0.0-rc.0",
18 | "@angular/core": "7.0.0-rc.0",
19 | "@angular/forms": "7.0.0-rc.0",
20 | "@angular/http": "7.0.0-rc.0",
21 | "@angular/platform-browser": "7.0.0-rc.0",
22 | "@angular/platform-browser-dynamic": "7.0.0-rc.0",
23 | "@angular/router": "7.0.0-rc.0",
24 | "@fortawesome/fontawesome-free": "5.3.1",
25 | "bootstrap": "4.1.3",
26 | "core-js": "2.5.7",
27 | "jquery": "3.3.1",
28 | "json-server": "0.14.0",
29 | "rxjs": "6.2.2",
30 | "typescript": "3.1.1",
31 | "zone.js": "0.8.26"
32 | },
33 | "devDependencies": {
34 | "@angular-devkit/build-angular": "0.9.0-rc.2",
35 | "@angular/cli": "7.0.0-rc.2",
36 | "@angular/compiler-cli": "7.0.0-rc.0",
37 | "@angular/language-service": "7.0.0-rc.0",
38 | "@types/jasmine": "2.8.8",
39 | "@types/jasminewd2": "2.0.3",
40 | "@types/node": "8.9.5",
41 | "codelyzer": "4.5.0",
42 | "jasmine-core": "2.99.1",
43 | "jasmine-spec-reporter": "4.2.1",
44 | "karma": "3.0.0",
45 | "karma-chrome-launcher": "2.2.0",
46 | "karma-coverage-istanbul-reporter": "2.0.4",
47 | "karma-jasmine": "1.1.2",
48 | "karma-jasmine-html-reporter": "0.2.2",
49 | "protractor": "5.4.1",
50 | "ts-node": "7.0.1",
51 | "tslint": "5.11.0"
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/proxy.conf.json:
--------------------------------------------------------------------------------
1 | {
2 | "/api": {
3 | "target": "http://localhost:3000",
4 | "secure": false
5 | }
6 | }
--------------------------------------------------------------------------------
/src/app/app.component.css:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/joeeames/PSAngularCrashCourse/f8ae9a154fd9f1ce53acc2ea895192078eb23e4a/src/app/app.component.css
--------------------------------------------------------------------------------
/src/app/app.component.html:
--------------------------------------------------------------------------------
1 |
14 |
15 |
16 |
17 |
18 | Date |
19 | Weight |
20 | Body Fat % |
21 |
22 |
23 |
24 |
25 | Date |
26 | Weight |
27 | Body Fat % |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/src/app/app.component.ts:
--------------------------------------------------------------------------------
1 | import { Component } from '@angular/core';
2 |
3 |
4 | @Component({
5 | selector: 'hm-root',
6 | templateUrl: './app.component.html',
7 | styleUrls: ['./app.component.css']
8 | })
9 | export class AppComponent {
10 |
11 |
12 | constructor() {}
13 |
14 | ngOnInit() {
15 | }
16 |
17 | }
18 |
--------------------------------------------------------------------------------
/src/app/app.module.ts:
--------------------------------------------------------------------------------
1 | import { BrowserModule } from '@angular/platform-browser';
2 | import { NgModule } from '@angular/core';
3 | import { CommonModule } from '@angular/common';
4 |
5 | import { AppComponent } from './app.component';
6 |
7 | @NgModule({
8 | declarations: [
9 | AppComponent,
10 | ],
11 | imports: [
12 | CommonModule,
13 | BrowserModule,
14 | ],
15 | providers: [],
16 | bootstrap: [AppComponent]
17 | })
18 | export class AppModule { }
19 |
--------------------------------------------------------------------------------
/src/assets/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/joeeames/PSAngularCrashCourse/f8ae9a154fd9f1ce53acc2ea895192078eb23e4a/src/assets/.gitkeep
--------------------------------------------------------------------------------
/src/assets/sb-admin.min.css:
--------------------------------------------------------------------------------
1 | /*!
2 | * Start Bootstrap - SB Admin v5.0.2 (https://startbootstrap.com/template-overviews/sb-admin)
3 | * Copyright 2013-2018 Start Bootstrap
4 | * Licensed under MIT (https://github.com/BlackrockDigital/startbootstrap-sb-admin/blob/master/LICENSE)
5 | */html{position:relative;min-height:100%}body{height:100%}#wrapper{display:-webkit-box;display:-ms-flexbox;display:flex}#wrapper #content-wrapper{overflow-x:hidden;width:100%;padding-top:1rem;padding-bottom:80px}body.fixed-nav #content-wrapper{margin-top:56px;padding-left:90px}body.fixed-nav.sidebar-toggled #content-wrapper{padding-left:0}@media (min-width:768px){body.fixed-nav #content-wrapper{padding-left:225px}body.fixed-nav.sidebar-toggled #content-wrapper{padding-left:90px}}.scroll-to-top{position:fixed;right:15px;bottom:15px;display:none;width:50px;height:50px;text-align:center;color:#fff;background:rgba(52,58,64,.5);line-height:46px}.scroll-to-top:focus,.scroll-to-top:hover{color:#fff}.scroll-to-top:hover{background:#343a40}.scroll-to-top i{font-weight:800}.smaller{font-size:.7rem}.o-hidden{overflow:hidden!important}.z-0{z-index:0}.z-1{z-index:1}.navbar-nav .form-inline .input-group{width:100%}.navbar-nav .nav-item.active .nav-link{color:#fff}.navbar-nav .nav-item.dropdown .dropdown-toggle::after{width:1rem;text-align:center;float:right;vertical-align:0;border:0;font-weight:900;content:'\f105';font-family:'Font Awesome 5 Free'}.navbar-nav .nav-item.dropdown.show .dropdown-toggle::after{content:'\f107'}.navbar-nav .nav-item.dropdown.no-arrow .dropdown-toggle::after{display:none}.navbar-nav .nav-item .nav-link:focus{outline:0}.navbar-nav .nav-item .nav-link .badge{position:absolute;margin-left:.75rem;top:.3rem;font-weight:400;font-size:.5rem}@media (min-width:768px){.navbar-nav .form-inline .input-group{width:auto}}.sidebar{width:90px!important;background-color:#212529;min-height:calc(100vh - 56px)}.sidebar .nav-item:last-child{margin-bottom:1rem}.sidebar .nav-item .nav-link{text-align:center;padding:.75rem 1rem;width:90px}.sidebar .nav-item .nav-link span{font-size:.65rem;display:block}.sidebar .nav-item .dropdown-menu{position:absolute!important;-webkit-transform:none!important;transform:none!important;left:calc(90px + .5rem)!important;margin:0}.sidebar .nav-item .dropdown-menu.dropup{bottom:0;top:auto!important}.sidebar .nav-item.dropdown .dropdown-toggle::after{display:none}.sidebar .nav-item .nav-link{color:rgba(255,255,255,.5)}.sidebar .nav-item .nav-link:active,.sidebar .nav-item .nav-link:focus,.sidebar .nav-item .nav-link:hover{color:rgba(255,255,255,.75)}.sidebar.toggled{width:0!important;overflow:hidden}@media (min-width:768px){.sidebar{width:225px!important}.sidebar .nav-item .nav-link{display:block;width:100%;text-align:left;padding:1rem;width:225px}.sidebar .nav-item .nav-link span{font-size:1rem;display:inline}.sidebar .nav-item .dropdown-menu{position:static!important;margin:0 1rem;top:0}.sidebar .nav-item.dropdown .dropdown-toggle::after{display:block}.sidebar.toggled{overflow:visible;width:90px!important}.sidebar.toggled .nav-item:last-child{margin-bottom:1rem}.sidebar.toggled .nav-item .nav-link{text-align:center;padding:.75rem 1rem;width:90px}.sidebar.toggled .nav-item .nav-link span{font-size:.65rem;display:block}.sidebar.toggled .nav-item .dropdown-menu{position:absolute!important;-webkit-transform:none!important;transform:none!important;left:calc(90px + .5rem)!important;margin:0}.sidebar.toggled .nav-item .dropdown-menu.dropup{bottom:0;top:auto!important}.sidebar.toggled .nav-item.dropdown .dropdown-toggle::after{display:none}}.sidebar.fixed-top{top:56px;height:calc(100vh - 56px);overflow-y:auto}.card-body-icon{position:absolute;z-index:0;top:-1.25rem;right:-1rem;opacity:.4;font-size:5rem;-webkit-transform:rotate(15deg);transform:rotate(15deg)}@media (min-width:576px){.card-columns{-webkit-column-count:1;column-count:1}}@media (min-width:768px){.card-columns{-webkit-column-count:2;column-count:2}}@media (min-width:1200px){.card-columns{-webkit-column-count:2;column-count:2}}:root{--input-padding-x:0.75rem;--input-padding-y:0.75rem}.card-login{max-width:25rem}.card-register{max-width:40rem}.form-label-group{position:relative}.form-label-group>input,.form-label-group>label{padding:var(--input-padding-y) var(--input-padding-x);height:auto}.form-label-group>label{position:absolute;top:0;left:0;display:block;width:100%;margin-bottom:0;line-height:1.5;color:#495057;border:1px solid transparent;border-radius:.25rem;-webkit-transition:all .1s ease-in-out;transition:all .1s ease-in-out}.form-label-group input::-webkit-input-placeholder{color:transparent}.form-label-group input:-ms-input-placeholder{color:transparent}.form-label-group input::-ms-input-placeholder{color:transparent}.form-label-group input::placeholder{color:transparent}.form-label-group input:not(:placeholder-shown){padding-top:calc(var(--input-padding-y) + var(--input-padding-y) * (2 / 3));padding-bottom:calc(var(--input-padding-y)/ 3)}.form-label-group input:not(:placeholder-shown)~label{padding-top:calc(var(--input-padding-y)/ 3);padding-bottom:calc(var(--input-padding-y)/ 3);font-size:12px;color:#777}footer.sticky-footer{display:-webkit-box;display:-ms-flexbox;display:flex;position:absolute;right:0;bottom:0;width:calc(100% - 90px);height:80px;background-color:#e9ecef}footer.sticky-footer .copyright{line-height:1;font-size:.8rem}@media (min-width:768px){footer.sticky-footer{width:calc(100% - 225px)}}body.sidebar-toggled footer.sticky-footer{width:100%}@media (min-width:768px){body.sidebar-toggled footer.sticky-footer{width:calc(100% - 90px)}}
--------------------------------------------------------------------------------
/src/assets/sb-admin.min.js:
--------------------------------------------------------------------------------
1 | /*!
2 | * Start Bootstrap - SB Admin v5.0.2 (https://startbootstrap.com/template-overviews/sb-admin)
3 | * Copyright 2013-2018 Start Bootstrap
4 | * Licensed under MIT (https://github.com/BlackrockDigital/startbootstrap-sb-admin/blob/master/LICENSE)
5 | */
6 |
7 | !function(t){"use strict";t("#sidebarToggle").click(function(e){e.preventDefault(),t("body").toggleClass("sidebar-toggled"),t(".sidebar").toggleClass("toggled")}),t("body.fixed-nav .sidebar").on("mousewheel DOMMouseScroll wheel",function(e){if(768<$window.width()){var o=e.originalEvent,t=o.wheelDelta||-o.detail;this.scrollTop+=30*(t<0?1:-1),e.preventDefault()}}),t(document).scroll(function(){100 0.5%
8 | last 2 versions
9 | Firefox ESR
10 | not dead
11 | not IE 9-11
--------------------------------------------------------------------------------
/src/environments/environment.prod.ts:
--------------------------------------------------------------------------------
1 | export const environment = {
2 | production: true
3 | };
4 |
--------------------------------------------------------------------------------
/src/environments/environment.ts:
--------------------------------------------------------------------------------
1 | // This file can be replaced during build by using the `fileReplacements` array.
2 | // `ng build --prod` replaces `environment.ts` with `environment.prod.ts`.
3 | // The list of file replacements can be found in `angular.json`.
4 |
5 | export const environment = {
6 | production: false
7 | };
8 |
9 | /*
10 | * For easier debugging in development mode, you can import the following file
11 | * to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`.
12 | *
13 | * This import should be commented out in production mode because it will have a negative impact
14 | * on performance if an error is thrown.
15 | */
16 | // import 'zone.js/dist/zone-error'; // Included with Angular CLI.
17 |
--------------------------------------------------------------------------------
/src/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/joeeames/PSAngularCrashCourse/f8ae9a154fd9f1ce53acc2ea895192078eb23e4a/src/favicon.ico
--------------------------------------------------------------------------------
/src/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Healthy Me
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/src/karma.conf.js:
--------------------------------------------------------------------------------
1 | // Karma configuration file, see link for more information
2 | // https://karma-runner.github.io/1.0/config/configuration-file.html
3 |
4 | module.exports = function (config) {
5 | config.set({
6 | basePath: '',
7 | frameworks: ['jasmine', '@angular-devkit/build-angular'],
8 | plugins: [
9 | require('karma-jasmine'),
10 | require('karma-chrome-launcher'),
11 | require('karma-jasmine-html-reporter'),
12 | require('karma-coverage-istanbul-reporter'),
13 | require('@angular-devkit/build-angular/plugins/karma')
14 | ],
15 | client: {
16 | clearContext: false // leave Jasmine Spec Runner output visible in browser
17 | },
18 | coverageIstanbulReporter: {
19 | dir: require('path').join(__dirname, '../coverage'),
20 | reports: ['html', 'lcovonly'],
21 | fixWebpackSourcePaths: true
22 | },
23 | reporters: ['progress', 'kjhtml'],
24 | port: 9876,
25 | colors: true,
26 | logLevel: config.LOG_INFO,
27 | autoWatch: true,
28 | browsers: ['Chrome'],
29 | singleRun: false
30 | });
31 | };
--------------------------------------------------------------------------------
/src/main.ts:
--------------------------------------------------------------------------------
1 | import { enableProdMode } from '@angular/core';
2 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
3 |
4 | import { AppModule } from './app/app.module';
5 | import { environment } from './environments/environment';
6 |
7 | if (environment.production) {
8 | enableProdMode();
9 | }
10 |
11 | platformBrowserDynamic().bootstrapModule(AppModule)
12 | .catch(err => console.error(err));
13 |
14 |
--------------------------------------------------------------------------------
/src/polyfills.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * This file includes polyfills needed by Angular and is loaded before the app.
3 | * You can add your own extra polyfills to this file.
4 | *
5 | * This file is divided into 2 sections:
6 | * 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers.
7 | * 2. Application imports. Files imported after ZoneJS that should be loaded before your main
8 | * file.
9 | *
10 | * The current setup is for so-called "evergreen" browsers; the last versions of browsers that
11 | * automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera),
12 | * Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile.
13 | *
14 | * Learn more in https://angular.io/docs/ts/latest/guide/browser-support.html
15 | */
16 |
17 | /***************************************************************************************************
18 | * BROWSER POLYFILLS
19 | */
20 |
21 | /** IE9, IE10 and IE11 requires all of the following polyfills. **/
22 | // import 'core-js/es6/symbol';
23 | // import 'core-js/es6/object';
24 | // import 'core-js/es6/function';
25 | // import 'core-js/es6/parse-int';
26 | // import 'core-js/es6/parse-float';
27 | // import 'core-js/es6/number';
28 | // import 'core-js/es6/math';
29 | // import 'core-js/es6/string';
30 | // import 'core-js/es6/date';
31 | // import 'core-js/es6/array';
32 | // import 'core-js/es6/regexp';
33 | // import 'core-js/es6/map';
34 | // import 'core-js/es6/weak-map';
35 | // import 'core-js/es6/set';
36 |
37 | /** IE10 and IE11 requires the following for NgClass support on SVG elements */
38 | // import 'classlist.js'; // Run `npm install --save classlist.js`.
39 |
40 | /** IE10 and IE11 requires the following for the Reflect API. */
41 | // import 'core-js/es6/reflect';
42 |
43 |
44 | /** Evergreen browsers require these. **/
45 | // Used for reflect-metadata in JIT. If you use AOT (and only Angular decorators), you can remove.
46 | import 'core-js/es7/reflect';
47 |
48 |
49 | /**
50 | * Web Animations `@angular/platform-browser/animations`
51 | * Only required if AnimationBuilder is used within the application and using IE/Edge or Safari.
52 | * Standard animation support in Angular DOES NOT require any polyfills (as of Angular 6.0).
53 | **/
54 | // import 'web-animations-js'; // Run `npm install --save web-animations-js`.
55 |
56 | /**
57 | * By default, zone.js will patch all possible macroTask and DomEvents
58 | * user can disable parts of macroTask/DomEvents patch by setting following flags
59 | */
60 |
61 | // (window as any).__Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame
62 | // (window as any).__Zone_disable_on_property = true; // disable patch onProperty such as onclick
63 | // (window as any).__zone_symbol__BLACK_LISTED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames
64 |
65 | /*
66 | * in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js
67 | * with the following flag, it will bypass `zone.js` patch for IE/Edge
68 | */
69 | // (window as any).__Zone_enable_cross_context_check = true;
70 |
71 | /***************************************************************************************************
72 | * Zone JS is required by default for Angular itself.
73 | */
74 | import 'zone.js/dist/zone'; // Included with Angular CLI.
75 |
76 |
77 |
78 | /***************************************************************************************************
79 | * APPLICATION IMPORTS
80 | */
81 |
--------------------------------------------------------------------------------
/src/styles.css:
--------------------------------------------------------------------------------
1 | /* You can add global styles to this file, and also import other style files */
2 |
--------------------------------------------------------------------------------
/src/test.ts:
--------------------------------------------------------------------------------
1 | // This file is required by karma.conf.js and loads recursively all the .spec and framework files
2 |
3 | import 'zone.js/dist/zone-testing';
4 | import { getTestBed } from '@angular/core/testing';
5 | import {
6 | BrowserDynamicTestingModule,
7 | platformBrowserDynamicTesting
8 | } from '@angular/platform-browser-dynamic/testing';
9 |
10 | declare const require: any;
11 |
12 | // First, initialize the Angular testing environment.
13 | getTestBed().initTestEnvironment(
14 | BrowserDynamicTestingModule,
15 | platformBrowserDynamicTesting()
16 | );
17 | // Then we find all the tests.
18 | const context = require.context('./', true, /\.spec\.ts$/);
19 | // And load the modules.
20 | context.keys().map(context);
21 |
--------------------------------------------------------------------------------
/src/tsconfig.app.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../out-tsc/app",
5 | "types": []
6 | },
7 | "exclude": [
8 | "test.ts",
9 | "**/*.spec.ts"
10 | ]
11 | }
12 |
--------------------------------------------------------------------------------
/src/tsconfig.spec.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../out-tsc/spec",
5 | "types": [
6 | "jasmine",
7 | "node"
8 | ]
9 | },
10 | "files": [
11 | "test.ts",
12 | "polyfills.ts"
13 | ],
14 | "include": [
15 | "**/*.spec.ts",
16 | "**/*.d.ts"
17 | ]
18 | }
19 |
--------------------------------------------------------------------------------
/src/tslint.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../tslint.json",
3 | "rules": {
4 | "directive-selector": [
5 | true,
6 | "attribute",
7 | "app",
8 | "camelCase"
9 | ],
10 | "component-selector": [
11 | true,
12 | "element",
13 | "app",
14 | "kebab-case"
15 | ]
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compileOnSave": false,
3 | "compilerOptions": {
4 | "baseUrl": "./",
5 | "outDir": "./dist/out-tsc",
6 | "sourceMap": true,
7 | "declaration": false,
8 | "module": "es2015",
9 | "moduleResolution": "node",
10 | "emitDecoratorMetadata": true,
11 | "experimentalDecorators": true,
12 | "target": "es5",
13 | "typeRoots": [
14 | "node_modules/@types"
15 | ],
16 | "lib": [
17 | "es2017",
18 | "dom"
19 | ]
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/tslint.json:
--------------------------------------------------------------------------------
1 | {
2 | "rulesDirectory": [
3 | "node_modules/codelyzer"
4 | ],
5 | "rules": {
6 | "arrow-return-shorthand": true,
7 | "callable-types": true,
8 | "class-name": true,
9 | "comment-format": [
10 | true,
11 | "check-space"
12 | ],
13 | "curly": true,
14 | "deprecation": {
15 | "severity": "warn"
16 | },
17 | "eofline": true,
18 | "forin": true,
19 | "import-blacklist": [
20 | true,
21 | "rxjs/Rx"
22 | ],
23 | "import-spacing": true,
24 | "indent": [
25 | true,
26 | "spaces"
27 | ],
28 | "interface-over-type-literal": true,
29 | "label-position": true,
30 | "max-line-length": [
31 | true,
32 | 140
33 | ],
34 | "member-access": false,
35 | "member-ordering": [
36 | true,
37 | {
38 | "order": [
39 | "static-field",
40 | "instance-field",
41 | "static-method",
42 | "instance-method"
43 | ]
44 | }
45 | ],
46 | "no-arg": true,
47 | "no-bitwise": true,
48 | "no-console": [
49 | true,
50 | "debug",
51 | "info",
52 | "time",
53 | "timeEnd",
54 | "trace"
55 | ],
56 | "no-construct": true,
57 | "no-debugger": true,
58 | "no-duplicate-super": true,
59 | "no-empty": false,
60 | "no-empty-interface": true,
61 | "no-eval": true,
62 | "no-inferrable-types": [
63 | true,
64 | "ignore-params"
65 | ],
66 | "no-misused-new": true,
67 | "no-non-null-assertion": true,
68 | "no-redundant-jsdoc": true,
69 | "no-shadowed-variable": true,
70 | "no-string-literal": false,
71 | "no-string-throw": true,
72 | "no-switch-case-fall-through": true,
73 | "no-trailing-whitespace": true,
74 | "no-unnecessary-initializer": true,
75 | "no-unused-expression": true,
76 | "no-use-before-declare": true,
77 | "no-var-keyword": true,
78 | "object-literal-sort-keys": false,
79 | "one-line": [
80 | true,
81 | "check-open-brace",
82 | "check-catch",
83 | "check-else",
84 | "check-whitespace"
85 | ],
86 | "prefer-const": true,
87 | "quotemark": [
88 | true,
89 | "single"
90 | ],
91 | "radix": true,
92 | "semicolon": [
93 | true,
94 | "always"
95 | ],
96 | "triple-equals": [
97 | true,
98 | "allow-null-check"
99 | ],
100 | "typedef-whitespace": [
101 | true,
102 | {
103 | "call-signature": "nospace",
104 | "index-signature": "nospace",
105 | "parameter": "nospace",
106 | "property-declaration": "nospace",
107 | "variable-declaration": "nospace"
108 | }
109 | ],
110 | "unified-signatures": true,
111 | "variable-name": false,
112 | "whitespace": [
113 | true,
114 | "check-branch",
115 | "check-decl",
116 | "check-operator",
117 | "check-separator",
118 | "check-type"
119 | ],
120 | "no-output-on-prefix": true,
121 | "use-input-property-decorator": true,
122 | "use-output-property-decorator": true,
123 | "use-host-property-decorator": true,
124 | "no-input-rename": true,
125 | "no-output-rename": true,
126 | "use-life-cycle-interface": true,
127 | "use-pipe-transform-interface": true,
128 | "component-class-suffix": true,
129 | "directive-class-suffix": true
130 | }
131 | }
132 |
--------------------------------------------------------------------------------