├── .angulardoc.json ├── .editorconfig ├── .gitignore ├── .prettierignore ├── .prettierrc ├── .vscode └── extensions.json ├── README.md ├── RESOURCES ├── assets │ ├── .gitkeep │ ├── background.jpg │ ├── localhost-4200.png │ └── logo.png └── styles.scss ├── angular.json ├── apps ├── .gitkeep ├── dashboard-e2e │ ├── protractor.conf.js │ ├── src │ │ ├── app.e2e-spec.ts │ │ └── app.po.ts │ ├── tsconfig.e2e.json │ └── tsconfig.json └── dashboard │ ├── browserslist │ ├── karma.conf.js │ ├── src │ ├── app │ │ ├── app-routing.module.ts │ │ ├── app.component.html │ │ ├── app.component.scss │ │ ├── app.component.spec.ts │ │ ├── app.component.ts │ │ ├── app.module.ts │ │ ├── customers │ │ │ ├── customers-routing.module.ts │ │ │ ├── customers.component.html │ │ │ ├── customers.component.scss │ │ │ ├── customers.component.spec.ts │ │ │ ├── customers.component.ts │ │ │ ├── customers.module.spec.ts │ │ │ └── customers.module.ts │ │ ├── home │ │ │ ├── home-routing.module.ts │ │ │ ├── home.component.html │ │ │ ├── home.component.scss │ │ │ ├── home.component.spec.ts │ │ │ ├── home.component.ts │ │ │ ├── home.module.spec.ts │ │ │ └── home.module.ts │ │ └── projects │ │ │ ├── project-details │ │ │ ├── project-details.component.html │ │ │ ├── project-details.component.scss │ │ │ ├── project-details.component.spec.ts │ │ │ └── project-details.component.ts │ │ │ ├── projects-list │ │ │ ├── projects-list.component.html │ │ │ ├── projects-list.component.scss │ │ │ ├── projects-list.component.spec.ts │ │ │ └── projects-list.component.ts │ │ │ ├── projects-routing.module.ts │ │ │ ├── projects.component.html │ │ │ ├── projects.component.scss │ │ │ ├── projects.component.spec.ts │ │ │ ├── projects.component.ts │ │ │ ├── projects.module.spec.ts │ │ │ └── projects.module.ts │ ├── assets │ │ ├── .gitkeep │ │ ├── background.jpg │ │ └── logo.png │ ├── environments │ │ ├── environment.prod.ts │ │ └── environment.ts │ ├── favicon.ico │ ├── index.html │ ├── main.ts │ ├── polyfills.ts │ ├── styles.scss │ └── test.ts │ ├── tsconfig.app.json │ ├── tsconfig.json │ ├── tsconfig.spec.json │ └── tslint.json ├── karma.conf.js ├── libs ├── .gitkeep ├── core-data │ ├── karma.conf.js │ ├── src │ │ ├── index.ts │ │ ├── lib │ │ │ ├── core-data.module.spec.ts │ │ │ ├── core-data.module.ts │ │ │ └── projects │ │ │ │ ├── project.ts │ │ │ │ ├── projects.service.spec.ts │ │ │ │ └── projects.service.ts │ │ └── test.ts │ ├── tsconfig.json │ ├── tsconfig.lib.json │ ├── tsconfig.spec.json │ └── tslint.json ├── material │ ├── karma.conf.js │ ├── src │ │ ├── index.ts │ │ ├── lib │ │ │ ├── material.module.spec.ts │ │ │ └── material.module.ts │ │ └── test.ts │ ├── tsconfig.json │ ├── tsconfig.lib.json │ ├── tsconfig.spec.json │ └── tslint.json ├── ui-login │ ├── karma.conf.js │ ├── src │ │ ├── index.ts │ │ ├── lib │ │ │ ├── login │ │ │ │ ├── login.component.html │ │ │ │ ├── login.component.scss │ │ │ │ ├── login.component.spec.ts │ │ │ │ └── login.component.ts │ │ │ ├── ui-login.module.spec.ts │ │ │ └── ui-login.module.ts │ │ └── test.ts │ ├── tsconfig.json │ ├── tsconfig.lib.json │ ├── tsconfig.spec.json │ └── tslint.json └── ui-toolbar │ ├── karma.conf.js │ ├── src │ ├── index.ts │ ├── lib │ │ ├── ui-toolbar.module.spec.ts │ │ └── ui-toolbar.module.ts │ └── test.ts │ ├── tsconfig.json │ ├── tsconfig.lib.json │ ├── tsconfig.spec.json │ └── tslint.json ├── nx.json ├── package-lock.json ├── package.json ├── server ├── db.json ├── server.js └── users.json ├── tools ├── schematics │ └── .gitkeep └── tsconfig.tools.json ├── tsconfig.json └── tslint.json /.angulardoc.json: -------------------------------------------------------------------------------- 1 | { 2 | "repoId": "1a61d617-5a11-4b60-b131-1eef58bef983", 3 | "lastSync": 0 4 | } -------------------------------------------------------------------------------- /.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 | .history/ 27 | 28 | # misc 29 | /.sass-cache 30 | /connect.lock 31 | /coverage 32 | /libpeerconnection.log 33 | npm-debug.log 34 | yarn-error.log 35 | testem.log 36 | /typings 37 | 38 | # System Files 39 | .DS_Store 40 | Thumbs.db 41 | -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | # Add files here to ignore them from prettier formatting 2 | -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "singleQuote": true 3 | } -------------------------------------------------------------------------------- /.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": [ 3 | "nrwl.angular-console", 4 | "angular.ng-template", 5 | "esbenp.prettier-vscode" 6 | ] 7 | } 8 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Angular Core Workshop 2 | 3 | We are going to use the Angular CLI and NRWL Extensions extensively in the workshop to streamline development and free us up to focus on core concepts. 4 | 5 | Follow the steps below to get started! 6 | 7 | > NOTE: If you start from the `01-getting-started` branch, the workspace and app is already generated with the correct npm scope set. 8 | 9 | ## The Stack 10 | 11 | ### NRWL Workspace 12 | A NRWL workspace contains one or all of you Angular projects and libraries. It creates a monorepo for your applications domains. Nx helps add extra layer of tooling that can help manage your enterprise applications. 13 | 14 | External Video Reference: [Angular in a Microservices world](https://www.youtube.com/watch?v=d04U7SjORTI) 15 | 16 | ### Angular Material 17 | Angular Material is a UI library for Angular that gives you access to a modern material UI that works across web, mobile, and desktop applications with minimal custom CSS and setup. 18 | 19 | ### JSON Server 20 | Creates a quick and simple way to mock out a backend REST service. We can then deliver some mocked out data in JSON format to make sure everything is working as expected once our real backend is connected. 21 | 22 | ## Getting Started 23 | 24 | An Nx workspace is an Angular CLI project that has been enhanced to be enterprise ready. Being an Angular CLI project means it will be handy to have the Angular CLI installed globally, which can be done via npm or yarn as well. 25 | 26 | ``` 27 | npm install -g @angular/cli 28 | ``` 29 | 30 | > Note: If you do not have the Angular CLI installed globally you may not be able to use ng from the terminal to run CLI commands within the project. But the package.json file comes with npm scripts to run ng commands, so you can run npm start to ng serve and you can run npm run ng to run any of the ng commands. 31 | 32 | After you have installed the Angular CLI, install `@nrwl/schematics`. 33 | 34 | ``` 35 | npm install -g @nrwl/schematics 36 | ``` 37 | 38 | After installing, if you want to create a new Nx workspace with an application, you can by running: 39 | 40 | ``` 41 | create-nx-workspace angular-core-workshop --preset=empty --cli=angular --npmScope=workshop 42 | ``` 43 | 44 | > NOTE: because the @nrwl/schematics have been installed the above command works, if you have issues with this command not working properly or would rather not install the Nrwl shcematics globally please refer to https://nx.dev/web/getting-started/getting-started for further instruction. 45 | 46 | After the workspace is created you will need to cd into the app directory `cd angular-core-workshop` and install the Nrwl Angular schematic: 47 | 48 | ``` 49 | ng add @nrwl/angular 50 | ``` 51 | 52 | The next step is to generate an app in your workspace. Do so by running: 53 | 54 | ``` 55 | ng generate @nrwl/angular:application dashboard 56 | ``` 57 | 58 | You'll then be prompted to answer a few setup questions. Run the following for each question: 59 | 60 | `Which stylesheet format would you like to use?` SASS(.scss) 61 | 62 | `Would you like to configure routing for this application?` y 63 | 64 | Lastly, please install the npm dependencies by running: 65 | 66 | ``` 67 | npm install 68 | ``` 69 | Then run the application: 70 | 71 | ``` 72 | npm run start 73 | ``` 74 | 75 | Navigate to `localhost:4200` and you should see this: 76 | 77 | ![](RESOURCES/assets/localhost-4200.png) 78 | 79 | You are good to go! 80 | -------------------------------------------------------------------------------- /RESOURCES/assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onehungrymind/angular-core-workshop/f20badbfc54c3f3018b035e6187e482895cebb8f/RESOURCES/assets/.gitkeep -------------------------------------------------------------------------------- /RESOURCES/assets/background.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onehungrymind/angular-core-workshop/f20badbfc54c3f3018b035e6187e482895cebb8f/RESOURCES/assets/background.jpg -------------------------------------------------------------------------------- /RESOURCES/assets/localhost-4200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onehungrymind/angular-core-workshop/f20badbfc54c3f3018b035e6187e482895cebb8f/RESOURCES/assets/localhost-4200.png -------------------------------------------------------------------------------- /RESOURCES/assets/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onehungrymind/angular-core-workshop/f20badbfc54c3f3018b035e6187e482895cebb8f/RESOURCES/assets/logo.png -------------------------------------------------------------------------------- /RESOURCES/styles.scss: -------------------------------------------------------------------------------- 1 | @import '~@angular/material/prebuilt-themes/deeppurple-amber.css'; 2 | html { 3 | height: 100%; 4 | } 5 | 6 | body { 7 | margin: 0; 8 | font-family: Roboto, sans-serif; 9 | height: 100%; 10 | display: flex; 11 | } 12 | 13 | p { 14 | margin: 16px; 15 | } 16 | 17 | .icon-20 { 18 | font-size: 20px; 19 | } 20 | 21 | * { 22 | -webkit-font-smoothing: antialiased; 23 | -moz-osx-font-smoothing: grayscale; 24 | } 25 | 26 | .container { 27 | display: flex; 28 | margin: 10px; 29 | flex-wrap: wrap; 30 | } 31 | 32 | .container [class*="col"] { 33 | padding: 10px; 34 | flex: 1; 35 | } 36 | 37 | .mat-card-header-text { 38 | margin-left: 0; 39 | border-bottom: 1px solid #ffd740; 40 | } 41 | 42 | .header { 43 | padding-bottom: 10px; 44 | color: #673ab7; 45 | border-bottom: 2px solid #673ab7; 46 | } 47 | 48 | app-root { 49 | display: flex; 50 | flex-direction: column; 51 | flex: 1; 52 | } 53 | 54 | mat-toolbar { 55 | box-shadow: 0 3px 5px -1px rgba(0, 0, 0, .2), 0 6px 10px 0 rgba(0, 0, 0, .14), 0 1px 18px 0 rgba(0, 0, 0, .12); 56 | z-index: 1; 57 | } 58 | 59 | mat-sidenav { 60 | box-shadow: 3px 0 6px rgba(0, 0, 0, .24); 61 | width: 200px; 62 | } 63 | 64 | mat-card:not(.dashboard-card) { 65 | margin-bottom: 20px; 66 | } 67 | 68 | .mat-sidenav-container { 69 | background: #f5f5f5; 70 | flex: 1; 71 | } 72 | 73 | .fill-remaining-space { 74 | flex: 1 1 auto; 75 | } 76 | 77 | .full-width { 78 | width: 100%; 79 | } 80 | 81 | .dashboard-card { 82 | position: absolute !important; 83 | top: 15px; 84 | left: 15px; 85 | right: 15px; 86 | bottom: 15px; 87 | mat-card-header { 88 | justify-content: center; 89 | } 90 | } 91 | 92 | .dashboard-card-content { 93 | text-align: center; 94 | } 95 | 96 | .more-button { 97 | position: absolute; 98 | top: 5px; 99 | right: 10px; 100 | } 101 | 102 | .grid-container { 103 | margin: 20px; 104 | } 105 | 106 | .list-container { 107 | margin: 20px; 108 | .full-width-table { 109 | width: 100%; 110 | } 111 | tr { 112 | -webkit-transition: background-color 300ms; 113 | -moz-transition: background-color 300ms; 114 | -ms-transition: background-color 300ms; 115 | -o-transition: background-color 300ms; 116 | transition: background-color 300ms; 117 | } 118 | tr:not(.mat-header-row):hover { 119 | background: whitesmoke; 120 | cursor: pointer; 121 | } 122 | } 123 | 124 | .details-container { 125 | mat-form-field { 126 | width: 100%; 127 | } 128 | mat-card-header { 129 | display: flex; 130 | justify-content: space-between; 131 | align-items: center; 132 | } 133 | } 134 | 135 | mat-list-item:not(:first-of-type) { 136 | border-top: 1px solid #efefef; 137 | } 138 | 139 | mat-form-field { 140 | width: 100%; 141 | } 142 | 143 | mat-list-item:hover { 144 | cursor: pointer; 145 | background: whitesmoke; 146 | } 147 | 148 | mat-list-item:not(:first-of-type) { 149 | border-top: 1px solid #efefef; 150 | } 151 | 152 | .symbol { 153 | color: #777; 154 | } 155 | 156 | mat-card-actions { 157 | margin-bottom: 0; 158 | } 159 | 160 | .full-width { 161 | width: 100%; 162 | } 163 | 164 | .nav-link { 165 | color: rgba(0, 0, 0, .54); 166 | display: flex !important; 167 | align-items: center; 168 | padding-top: 5px; 169 | padding-bottom: 5px; 170 | } 171 | 172 | // UI LOGIN 173 | ui-login { 174 | height: 100%; 175 | .background { 176 | position: fixed; 177 | left: 0; 178 | right: 0; 179 | z-index: 1; 180 | display: block; 181 | background: url(assets/background.jpg) no-repeat center center fixed; 182 | background-size: cover; 183 | height: 100%; 184 | overflow: hidden; 185 | } 186 | .container { 187 | position: fixed; 188 | left: 0; 189 | right: 0; 190 | top: 0; 191 | bottom: 0; 192 | z-index: 100; 193 | .card-wrapper { 194 | margin: auto; 195 | display: flex; 196 | justify-content: center; 197 | } 198 | } 199 | mat-card { 200 | box-shadow: 0 3px 5px -1px rgba(0, 0, 0, 0.2), 0 6px 10px 0 rgba(0, 0, 0, 0.14), 0 1px 18px 0 rgba(0, 0, 0, 0.12); 201 | mat-card-header { 202 | margin-bottom: 10px; 203 | } 204 | mat-form-field { 205 | width: 100%; 206 | } 207 | } 208 | .ig-xpro2 { 209 | -webkit-filter: contrast(1.3) brightness(0.8) sepia(0.3) saturate(1.5) hue-rotate(-20deg); 210 | filter: contrast(1.3) brightness(0.8) sepia(0.3) saturate(1.5) hue-rotate(-20deg); 211 | } 212 | .ig-willow { 213 | -webkit-filter: saturate(0.02) contrast(0.85) brightness(1.2) sepia(0.02); 214 | filter: saturate(0.02) contrast(0.85) brightness(1.2) sepia(0.02); 215 | } 216 | .ig-walden { 217 | -webkit-filter: sepia(0.35) contrast(0.9) brightness(1.1) hue-rotate(-10deg) saturate(1.5); 218 | filter: sepia(0.35) contrast(0.9) brightness(1.1) hue-rotate(-10deg) saturate(1.5); 219 | } 220 | .ig-valencia { 221 | -webkit-filter: sepia(0.15) saturate(1.5) contrast(0.9); 222 | filter: sepia(0.15) saturate(1.5) contrast(0.9); 223 | } 224 | .ig-toaster { 225 | -webkit-filter: sepia(0.4) saturate(2.5) hue-rotate(-30deg) contrast(0.67); 226 | -filter: sepia(0.4) saturate(2.5) hue-rotate(-30deg) contrast(0.67); 227 | } 228 | .ig-sutro { 229 | -webkit-filter: brightness(0.75) contrast(1.3) sepia(0.5) hue-rotate(-25deg); 230 | filter: brightness(0.75) contrast(1.3) sepia(0.5) hue-rotate(-25deg); 231 | } 232 | .ig-sierra { 233 | -webkit-filter: contrast(0.8) saturate(1.2) sepia(0.15); 234 | filter: contrast(0.8) saturate(1.2) sepia(0.15); 235 | } 236 | .ig-rise { 237 | -webkit-filter: saturate(1.4) sepia(0.25) hue-rotate(-15deg) contrast(0.8) brightness(1.1); 238 | filter: saturate(1.4) sepia(0.25) hue-rotate(-15deg) contrast(0.8) brightness(1.1); 239 | } 240 | .ig-nashville { 241 | -webkit-filter: sepia(0.4) saturate(1.5) contrast(0.9) brightness(1.1) hue-rotate(-15deg); 242 | filter: sepia(0.4) saturate(1.5) contrast(0.9) brightness(1.1) hue-rotate(-15deg); 243 | } 244 | .ig-mayfair { 245 | -webkit-filter: saturate(1.4) contrast(1.1); 246 | filter: saturate(1.4) contrast(1.1); 247 | } 248 | .ig-lofi { 249 | filter: contrast(1.4) brightness(0.9) sepia(0.05); 250 | -webkit-filter: contrast(1.4) brightness(0.9) sepia(0.05); 251 | } 252 | .ig-kelvin { 253 | filter: sepia(0.4) saturate(2.4) brightness(1.3) contrast(1); 254 | -webkit-filter: sepia(0.4) saturate(2.4) brightness(1.3) contrast(1); 255 | } 256 | .ig-inkwell { 257 | -webkit-filter: grayscale(1) brightness(1.2) contrast(1.05); 258 | filter: grayscale(1) brightness(1.2) contrast(1.05); 259 | } 260 | .ig-hudson { 261 | -webkit-filter: contrast(1.2) brightness(0.9) hue-rotate(-10deg); 262 | filter: contrast(1.2) brightness(0.9) hue-rotate(-10deg); 263 | } 264 | .hefe { 265 | -webkit-filter: contrast(1.3) sepia(0.3) saturate(1.3) hue-rotate(-10deg) brightness(0.95); 266 | filter: contrast(1.3) sepia(0.3) saturate(1.3) hue-rotate(-10deg) brightness(0.95); 267 | } 268 | .ig-earlybird { 269 | -webkit-filter: sepia(0.4) saturate(1.6) contrast(1.1) brightness(0.9) hue-rotate(-10deg); 270 | filter: sepia(0.4) saturate(1.6) contrast(1.1) brightness(0.9) hue-rotate(-10deg); 271 | } 272 | .ig-brannan { 273 | -webkit-filter: sepia(0.5) contrast(1.4); 274 | filter: sepia(0.5) contrast(1.4); 275 | } 276 | .ig-amaro { 277 | -webkit-filter: hue-rotate(-10deg) contrast(0.9) brightness(1.1) saturate(1.5); 278 | filter: hue-rotate(-10deg) contrast(0.9) brightness(1.1) saturate(1.5); 279 | } 280 | .ig-1977 { 281 | -webkit-filter: sepia(0.5) hue-rotate(-30deg) saturate(1.2) contrast(0.8); 282 | filter: sepia(0.5) hue-rotate(-30deg) saturate(1.2) contrast(0.8); 283 | } 284 | } 285 | 286 | // UI TOOLBAR 287 | mat-toolbar { 288 | box-shadow: 0 3px 5px -1px rgba(0, 0, 0, 0.2), 0 6px 10px 0 rgba(0, 0, 0, 0.14), 0 1px 18px 0 rgba(0, 0, 0, 0.12); 289 | z-index: 900; 290 | >.mat-mini-fab { 291 | margin-right: 10px; 292 | } 293 | .spacer { 294 | flex: 1 1 auto; 295 | } 296 | .title { 297 | vertical-align: middle; 298 | } 299 | .logo { 300 | margin-left: 20px; 301 | img { 302 | vertical-align: middle; 303 | width: 100px; 304 | height: auto; 305 | } 306 | } 307 | } 308 | -------------------------------------------------------------------------------- /angular.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "./node_modules/@angular/cli/lib/config/schema.json", 3 | "version": 1, 4 | "newProjectRoot": "", 5 | "projects": { 6 | "dashboard": { 7 | "root": "apps/dashboard/", 8 | "sourceRoot": "apps/dashboard/src", 9 | "projectType": "application", 10 | "prefix": "app", 11 | "schematics": { 12 | "@schematics/angular:component": { 13 | "styleext": "scss" 14 | } 15 | }, 16 | "architect": { 17 | "build": { 18 | "builder": "@angular-devkit/build-angular:browser", 19 | "options": { 20 | "outputPath": "dist/apps/dashboard", 21 | "index": "apps/dashboard/src/index.html", 22 | "main": "apps/dashboard/src/main.ts", 23 | "polyfills": "apps/dashboard/src/polyfills.ts", 24 | "tsConfig": "apps/dashboard/tsconfig.app.json", 25 | "assets": [ 26 | "apps/dashboard/src/favicon.ico", 27 | "apps/dashboard/src/assets" 28 | ], 29 | "styles": [ 30 | "./node_modules/@angular/material/prebuilt-themes/indigo-pink.css", 31 | "apps/dashboard/src/styles.scss" 32 | ], 33 | "scripts": [] 34 | }, 35 | "configurations": { 36 | "production": { 37 | "fileReplacements": [ 38 | { 39 | "replace": "apps/dashboard/src/environments/environment.ts", 40 | "with": "apps/dashboard/src/environments/environment.prod.ts" 41 | } 42 | ], 43 | "optimization": true, 44 | "outputHashing": "all", 45 | "sourceMap": false, 46 | "extractCss": true, 47 | "namedChunks": false, 48 | "aot": true, 49 | "extractLicenses": true, 50 | "vendorChunk": false, 51 | "buildOptimizer": true 52 | } 53 | } 54 | }, 55 | "serve": { 56 | "builder": "@angular-devkit/build-angular:dev-server", 57 | "options": { 58 | "browserTarget": "dashboard:build" 59 | }, 60 | "configurations": { 61 | "production": { 62 | "browserTarget": "dashboard:build:production" 63 | } 64 | } 65 | }, 66 | "extract-i18n": { 67 | "builder": "@angular-devkit/build-angular:extract-i18n", 68 | "options": { 69 | "browserTarget": "dashboard:build" 70 | } 71 | }, 72 | "test": { 73 | "builder": "@angular-devkit/build-angular:karma", 74 | "options": { 75 | "main": "apps/dashboard/src/test.ts", 76 | "polyfills": "apps/dashboard/src/polyfills.ts", 77 | "tsConfig": "apps/dashboard/tsconfig.spec.json", 78 | "karmaConfig": "apps/dashboard/karma.conf.js", 79 | "styles": [ 80 | "./node_modules/@angular/material/prebuilt-themes/indigo-pink.css", 81 | "apps/dashboard/src/styles.scss" 82 | ], 83 | "scripts": [], 84 | "assets": [ 85 | "apps/dashboard/src/favicon.ico", 86 | "apps/dashboard/src/assets" 87 | ] 88 | } 89 | }, 90 | "lint": { 91 | "builder": "@angular-devkit/build-angular:tslint", 92 | "options": { 93 | "tsConfig": [ 94 | "apps/dashboard/tsconfig.app.json", 95 | "apps/dashboard/tsconfig.spec.json" 96 | ], 97 | "exclude": ["**/node_modules/**", "!apps/dashboard/**"] 98 | } 99 | } 100 | } 101 | }, 102 | "dashboard-e2e": { 103 | "root": "apps/dashboard-e2e/", 104 | "projectType": "application", 105 | "architect": { 106 | "e2e": { 107 | "builder": "@angular-devkit/build-angular:protractor", 108 | "options": { 109 | "protractorConfig": "apps/dashboard-e2e/protractor.conf.js", 110 | "devServerTarget": "dashboard:serve" 111 | }, 112 | "configurations": { 113 | "production": { 114 | "devServerTarget": "dashboard:serve:production" 115 | } 116 | } 117 | }, 118 | "lint": { 119 | "builder": "@angular-devkit/build-angular:tslint", 120 | "options": { 121 | "tsConfig": "apps/dashboard-e2e/tsconfig.e2e.json", 122 | "exclude": ["**/node_modules/**", "!apps/dashboard-e2e/**"] 123 | } 124 | } 125 | } 126 | }, 127 | "material": { 128 | "root": "libs/material", 129 | "sourceRoot": "libs/material/src", 130 | "projectType": "library", 131 | "prefix": "workshop", 132 | "architect": { 133 | "test": { 134 | "builder": "@angular-devkit/build-angular:karma", 135 | "options": { 136 | "main": "libs/material/src/test.ts", 137 | "tsConfig": "libs/material/tsconfig.spec.json", 138 | "karmaConfig": "libs/material/karma.conf.js" 139 | } 140 | }, 141 | "lint": { 142 | "builder": "@angular-devkit/build-angular:tslint", 143 | "options": { 144 | "tsConfig": [ 145 | "libs/material/tsconfig.lib.json", 146 | "libs/material/tsconfig.spec.json" 147 | ], 148 | "exclude": ["**/node_modules/**", "!libs/material/**"] 149 | } 150 | } 151 | } 152 | }, 153 | "core-data": { 154 | "root": "libs/core-data", 155 | "sourceRoot": "libs/core-data/src", 156 | "projectType": "library", 157 | "prefix": "workshop", 158 | "architect": { 159 | "test": { 160 | "builder": "@angular-devkit/build-angular:karma", 161 | "options": { 162 | "main": "libs/core-data/src/test.ts", 163 | "tsConfig": "libs/core-data/tsconfig.spec.json", 164 | "karmaConfig": "libs/core-data/karma.conf.js" 165 | } 166 | }, 167 | "lint": { 168 | "builder": "@angular-devkit/build-angular:tslint", 169 | "options": { 170 | "tsConfig": [ 171 | "libs/core-data/tsconfig.lib.json", 172 | "libs/core-data/tsconfig.spec.json" 173 | ], 174 | "exclude": ["**/node_modules/**", "!libs/core-data/**"] 175 | } 176 | } 177 | } 178 | }, 179 | "ui-login": { 180 | "root": "libs/ui-login", 181 | "sourceRoot": "libs/ui-login/src", 182 | "projectType": "library", 183 | "prefix": "ui", 184 | "architect": { 185 | "test": { 186 | "builder": "@angular-devkit/build-angular:karma", 187 | "options": { 188 | "main": "libs/ui-login/src/test.ts", 189 | "tsConfig": "libs/ui-login/tsconfig.spec.json", 190 | "karmaConfig": "libs/ui-login/karma.conf.js" 191 | } 192 | }, 193 | "lint": { 194 | "builder": "@angular-devkit/build-angular:tslint", 195 | "options": { 196 | "tsConfig": [ 197 | "libs/ui-login/tsconfig.lib.json", 198 | "libs/ui-login/tsconfig.spec.json" 199 | ], 200 | "exclude": ["**/node_modules/**", "!libs/ui-login/**"] 201 | } 202 | } 203 | } 204 | }, 205 | "ui-toolbar": { 206 | "root": "libs/ui-toolbar", 207 | "sourceRoot": "libs/ui-toolbar/src", 208 | "projectType": "library", 209 | "prefix": "ui", 210 | "architect": { 211 | "test": { 212 | "builder": "@angular-devkit/build-angular:karma", 213 | "options": { 214 | "main": "libs/ui-toolbar/src/test.ts", 215 | "tsConfig": "libs/ui-toolbar/tsconfig.spec.json", 216 | "karmaConfig": "libs/ui-toolbar/karma.conf.js" 217 | } 218 | }, 219 | "lint": { 220 | "builder": "@angular-devkit/build-angular:tslint", 221 | "options": { 222 | "tsConfig": [ 223 | "libs/ui-toolbar/tsconfig.lib.json", 224 | "libs/ui-toolbar/tsconfig.spec.json" 225 | ], 226 | "exclude": ["**/node_modules/**", "!libs/ui-toolbar/**"] 227 | } 228 | } 229 | } 230 | } 231 | }, 232 | "cli": { 233 | "warnings": { 234 | "typescriptMismatch": false, 235 | "versionMismatch": false 236 | }, 237 | "defaultCollection": "@nrwl/angular" 238 | }, 239 | "schematics": { 240 | "@nrwl/schematics:component": { 241 | "styleext": "scss" 242 | }, 243 | "@nrwl/schematics:library": { 244 | "unitTestRunner": "karma", 245 | "framework": "angular" 246 | }, 247 | "@nrwl/schematics:application": { 248 | "unitTestRunner": "karma", 249 | "e2eTestRunner": "protractor" 250 | }, 251 | "@nrwl/schematics:node-application": { 252 | "framework": "express" 253 | } 254 | }, 255 | "defaultProject": "dashboard" 256 | } 257 | -------------------------------------------------------------------------------- /apps/.gitkeep: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /apps/dashboard-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 | }; -------------------------------------------------------------------------------- /apps/dashboard-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 dashboard!'); 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /apps/dashboard-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('app-root h1')).getText(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /apps/dashboard-e2e/tsconfig.e2e.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../dist/out-tsc", 5 | "module": "commonjs", 6 | "target": "es5", 7 | "types": ["jasmine", "jasminewd2", "node"] 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /apps/dashboard-e2e/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "types": ["jasmine", "jasminewd2", "node"] 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /apps/dashboard/browserslist: -------------------------------------------------------------------------------- 1 | # This file is currently used by autoprefixer to adjust CSS to support the below specified browsers 2 | # For additional information regarding the format and rule options, please see: 3 | # https://github.com/browserslist/browserslist#queries 4 | # 5 | # For IE 9-11 support, please remove 'not' from the last line of the file and adjust as needed 6 | 7 | > 0.5% 8 | last 2 versions 9 | Firefox ESR 10 | not dead 11 | not IE 9-11 -------------------------------------------------------------------------------- /apps/dashboard/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 | const { join } = require('path'); 5 | const getBaseKarmaConfig = require('../../karma.conf'); 6 | 7 | module.exports = function(config) { 8 | const baseConfig = getBaseKarmaConfig(); 9 | config.set({ 10 | ...baseConfig, 11 | coverageIstanbulReporter: { 12 | ...baseConfig.coverageIstanbulReporter, 13 | dir: join(__dirname, '../../coverage/apps/dashboard') 14 | } 15 | }); 16 | }; 17 | -------------------------------------------------------------------------------- /apps/dashboard/src/app/app-routing.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { RouterModule, Routes } from '@angular/router'; 3 | import { LoginComponent } from '@workshop/ui-login'; 4 | 5 | const routes: Routes = [ 6 | { path: '', loadChildren: () => import('./home/home.module').then(m => m.HomeModule) }, 7 | { path: 'projects', loadChildren: () => import('./projects/projects.module').then(m => m.ProjectsModule) }, 8 | { path: 'customers', loadChildren: () => import('./customers/customers.module').then(m => m.CustomersModule) }, 9 | { path: 'login', component: LoginComponent } 10 | ]; 11 | 12 | @NgModule({ 13 | imports: [RouterModule.forRoot(routes)], 14 | exports: [RouterModule] 15 | }) 16 | export class AppRoutingModule { } 17 | -------------------------------------------------------------------------------- /apps/dashboard/src/app/app.component.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 9 | 10 | {{title}} 11 | 12 | 13 | 14 | 17 | 18 | 19 | 20 | 21 | 31 | 32 | 33 |
34 | 35 |
36 |
37 | -------------------------------------------------------------------------------- /apps/dashboard/src/app/app.component.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onehungrymind/angular-core-workshop/f20badbfc54c3f3018b035e6187e482895cebb8f/apps/dashboard/src/app/app.component.scss -------------------------------------------------------------------------------- /apps/dashboard/src/app/app.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, TestBed } from '@angular/core/testing'; 2 | import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; 3 | import { RouterTestingModule } from '@angular/router/testing'; 4 | import { MaterialModule } from '@workshop/material'; 5 | 6 | import { AppComponent } from './app.component'; 7 | import { CoreDataModule } from '@workshop/core-data'; 8 | 9 | describe('AppComponent', () => { 10 | beforeEach(async(() => { 11 | TestBed.configureTestingModule({ 12 | imports: [ 13 | RouterTestingModule, 14 | MaterialModule, 15 | BrowserAnimationsModule 16 | ], 17 | declarations: [AppComponent] 18 | }).compileComponents(); 19 | })); 20 | 21 | it('should create the app', () => { 22 | const fixture = TestBed.createComponent(AppComponent); 23 | const app = fixture.debugElement.componentInstance; 24 | expect(app).toBeTruthy(); 25 | }); 26 | 27 | it(`should have as title 'dashboard'`, () => { 28 | const title = 'Angular Core Workshop'; 29 | const fixture = TestBed.createComponent(AppComponent); 30 | const app = fixture.debugElement.componentInstance; 31 | expect(app.title).toEqual(title); 32 | }); 33 | 34 | it('should render title in the right element', () => { 35 | const title = 'Angular Core Workshop'; 36 | const fixture = TestBed.createComponent(AppComponent); 37 | fixture.detectChanges(); 38 | const compiled = fixture.debugElement.nativeElement; 39 | expect(compiled.querySelector('.title').textContent).toContain(title); 40 | }); 41 | }); 42 | -------------------------------------------------------------------------------- /apps/dashboard/src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-root', 5 | templateUrl: './app.component.html', 6 | styleUrls: ['./app.component.scss'] 7 | }) 8 | export class AppComponent { 9 | title = 'Angular Core Workshop'; 10 | 11 | links = [ 12 | { path: '/', icon: 'home', title: 'Home'}, 13 | { path: '/customers', icon: 'face', title: 'Customer'}, 14 | { path: '/projects', icon: 'work', title: 'Projects'}, 15 | ] 16 | } 17 | -------------------------------------------------------------------------------- /apps/dashboard/src/app/app.module.ts: -------------------------------------------------------------------------------- 1 | import { HttpClientModule } from '@angular/common/http'; 2 | import { NgModule } from '@angular/core'; 3 | import { FormsModule } from '@angular/forms'; 4 | import { BrowserModule } from '@angular/platform-browser'; 5 | import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; 6 | import { NxModule } from '@nrwl/angular'; 7 | import { MaterialModule } from '@workshop/material'; 8 | import { UiLoginModule } from '@workshop/ui-login'; 9 | 10 | import { AppRoutingModule } from './app-routing.module'; 11 | import { AppComponent } from './app.component'; 12 | 13 | @NgModule({ 14 | declarations: [AppComponent], 15 | imports: [ 16 | BrowserModule, 17 | NxModule.forRoot(), 18 | BrowserAnimationsModule, 19 | FormsModule, 20 | HttpClientModule, 21 | MaterialModule, 22 | UiLoginModule, 23 | AppRoutingModule 24 | ], 25 | providers: [], 26 | bootstrap: [AppComponent] 27 | }) 28 | export class AppModule {} 29 | -------------------------------------------------------------------------------- /apps/dashboard/src/app/customers/customers-routing.module.ts: -------------------------------------------------------------------------------- 1 | import { CustomersComponent } from './customers.component'; 2 | import { NgModule } from '@angular/core'; 3 | import { Routes, RouterModule } from '@angular/router'; 4 | 5 | const routes: Routes = [ 6 | { 7 | path: '', component: CustomersComponent 8 | } 9 | ]; 10 | 11 | @NgModule({ 12 | imports: [RouterModule.forChild(routes)], 13 | exports: [RouterModule] 14 | }) 15 | export class CustomersRoutingModule { } 16 | -------------------------------------------------------------------------------- /apps/dashboard/src/app/customers/customers.component.html: -------------------------------------------------------------------------------- 1 |

2 | customers works! 3 |

4 | -------------------------------------------------------------------------------- /apps/dashboard/src/app/customers/customers.component.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onehungrymind/angular-core-workshop/f20badbfc54c3f3018b035e6187e482895cebb8f/apps/dashboard/src/app/customers/customers.component.scss -------------------------------------------------------------------------------- /apps/dashboard/src/app/customers/customers.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { CustomersComponent } from './customers.component'; 4 | 5 | describe('CustomersComponent', () => { 6 | let component: CustomersComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ CustomersComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(CustomersComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /apps/dashboard/src/app/customers/customers.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-customers', 5 | templateUrl: './customers.component.html', 6 | styleUrls: ['./customers.component.scss'] 7 | }) 8 | export class CustomersComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /apps/dashboard/src/app/customers/customers.module.spec.ts: -------------------------------------------------------------------------------- 1 | import { CustomersModule } from './customers.module'; 2 | 3 | describe('CustomersModule', () => { 4 | let customersModule: CustomersModule; 5 | 6 | beforeEach(() => { 7 | customersModule = new CustomersModule(); 8 | }); 9 | 10 | it('should create an instance', () => { 11 | expect(customersModule).toBeTruthy(); 12 | }); 13 | }); 14 | -------------------------------------------------------------------------------- /apps/dashboard/src/app/customers/customers.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { CommonModule } from '@angular/common'; 3 | 4 | import { CustomersRoutingModule } from './customers-routing.module'; 5 | import { CustomersComponent } from './customers.component'; 6 | 7 | @NgModule({ 8 | imports: [ 9 | CommonModule, 10 | CustomersRoutingModule 11 | ], 12 | declarations: [CustomersComponent] 13 | }) 14 | export class CustomersModule { } 15 | -------------------------------------------------------------------------------- /apps/dashboard/src/app/home/home-routing.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { Routes, RouterModule } from '@angular/router'; 3 | import { HomeComponent } from './home.component'; 4 | 5 | const routes: Routes = [ 6 | {path:'', component: HomeComponent} 7 | ]; 8 | 9 | @NgModule({ 10 | imports: [RouterModule.forChild(routes)], 11 | exports: [RouterModule] 12 | }) 13 | export class HomeRoutingModule { } 14 | -------------------------------------------------------------------------------- /apps/dashboard/src/app/home/home.component.html: -------------------------------------------------------------------------------- 1 |

2 | home works! 3 |

4 | -------------------------------------------------------------------------------- /apps/dashboard/src/app/home/home.component.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onehungrymind/angular-core-workshop/f20badbfc54c3f3018b035e6187e482895cebb8f/apps/dashboard/src/app/home/home.component.scss -------------------------------------------------------------------------------- /apps/dashboard/src/app/home/home.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { HomeComponent } from './home.component'; 4 | 5 | describe('HomeComponent', () => { 6 | let component: HomeComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ HomeComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(HomeComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /apps/dashboard/src/app/home/home.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-home', 5 | templateUrl: './home.component.html', 6 | styleUrls: ['./home.component.scss'] 7 | }) 8 | export class HomeComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /apps/dashboard/src/app/home/home.module.spec.ts: -------------------------------------------------------------------------------- 1 | import { HomeModule } from './home.module'; 2 | 3 | describe('HomeModule', () => { 4 | let homeModule: HomeModule; 5 | 6 | beforeEach(() => { 7 | homeModule = new HomeModule(); 8 | }); 9 | 10 | it('should create an instance', () => { 11 | expect(homeModule).toBeTruthy(); 12 | }); 13 | }); 14 | -------------------------------------------------------------------------------- /apps/dashboard/src/app/home/home.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { CommonModule } from '@angular/common'; 3 | 4 | import { HomeRoutingModule } from './home-routing.module'; 5 | import { HomeComponent } from './home.component'; 6 | 7 | @NgModule({ 8 | imports: [ 9 | CommonModule, 10 | HomeRoutingModule 11 | ], 12 | declarations: [HomeComponent], 13 | exports: [HomeComponent] 14 | }) 15 | export class HomeModule { } 16 | -------------------------------------------------------------------------------- /apps/dashboard/src/app/projects/project-details/project-details.component.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |

5 | {{originalTitle}} 6 | Select a Project 7 |

8 |
9 |
10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 |

{{currentProject.percentComplete}}% Complete

20 | 21 | 22 |
23 |
24 | 25 | Approved By Customer 26 | 27 |
28 |
29 | 30 | 31 | 32 | 33 |
34 |
35 | -------------------------------------------------------------------------------- /apps/dashboard/src/app/projects/project-details/project-details.component.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onehungrymind/angular-core-workshop/f20badbfc54c3f3018b035e6187e482895cebb8f/apps/dashboard/src/app/projects/project-details/project-details.component.scss -------------------------------------------------------------------------------- /apps/dashboard/src/app/projects/project-details/project-details.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | import { FormsModule } from '@angular/forms'; 3 | import { Project } from '@workshop/core-data'; 4 | import { MaterialModule } from '@workshop/material'; 5 | 6 | import { ProjectDetailsComponent } from './project-details.component'; 7 | import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; 8 | 9 | describe('ProjectDetailsComponent', () => { 10 | let component: ProjectDetailsComponent; 11 | let fixture: ComponentFixture; 12 | const emptyProject: Project = { 13 | id: null, 14 | title: '', 15 | details: '', 16 | percentComplete: 0, 17 | approved: false, 18 | } 19 | 20 | beforeEach(async(() => { 21 | TestBed.configureTestingModule({ 22 | declarations: [ ProjectDetailsComponent ], 23 | imports: [ 24 | MaterialModule, 25 | FormsModule, 26 | BrowserAnimationsModule 27 | ] 28 | }) 29 | .compileComponents(); 30 | })); 31 | 32 | beforeEach(() => { 33 | fixture = TestBed.createComponent(ProjectDetailsComponent); 34 | component = fixture.componentInstance; 35 | component.currentProject = emptyProject; 36 | fixture.detectChanges(); 37 | }); 38 | 39 | it('should create', () => { 40 | expect(component).toBeTruthy(); 41 | }); 42 | }); 43 | -------------------------------------------------------------------------------- /apps/dashboard/src/app/projects/project-details/project-details.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, EventEmitter, Input, Output } from '@angular/core'; 2 | import { Project } from '@workshop/core-data'; 3 | 4 | @Component({ 5 | selector: 'app-project-details', 6 | templateUrl: './project-details.component.html', 7 | styleUrls: ['./project-details.component.scss'] 8 | }) 9 | export class ProjectDetailsComponent { 10 | currentProject: Project; 11 | originalTitle; 12 | @Output() saved = new EventEmitter(); 13 | @Output() cancelled = new EventEmitter(); 14 | 15 | @Input() set project(value) { 16 | if(value) this.originalTitle = value.title; 17 | this.currentProject = Object.assign({}, value); 18 | }; 19 | } 20 | -------------------------------------------------------------------------------- /apps/dashboard/src/app/projects/projects-list/projects-list.component.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |

Projects

5 |
6 |
7 | 8 | 9 | 12 |

13 | {{project.title}} 14 |

15 |

16 | {{project.details}} 17 |

18 | 22 |
23 |
24 |
25 |
26 | -------------------------------------------------------------------------------- /apps/dashboard/src/app/projects/projects-list/projects-list.component.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onehungrymind/angular-core-workshop/f20badbfc54c3f3018b035e6187e482895cebb8f/apps/dashboard/src/app/projects/projects-list/projects-list.component.scss -------------------------------------------------------------------------------- /apps/dashboard/src/app/projects/projects-list/projects-list.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { ProjectsListComponent } from './projects-list.component'; 4 | import { MaterialModule } from '@workshop/material'; 5 | import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; 6 | 7 | describe('ProjectsListComponent', () => { 8 | let component: ProjectsListComponent; 9 | let fixture: ComponentFixture; 10 | 11 | beforeEach(async(() => { 12 | TestBed.configureTestingModule({ 13 | declarations: [ ProjectsListComponent ], 14 | imports: [ 15 | MaterialModule, 16 | BrowserAnimationsModule 17 | ] 18 | }) 19 | .compileComponents(); 20 | })); 21 | 22 | beforeEach(() => { 23 | fixture = TestBed.createComponent(ProjectsListComponent); 24 | component = fixture.componentInstance; 25 | fixture.detectChanges(); 26 | }); 27 | 28 | it('should create', () => { 29 | expect(component).toBeTruthy(); 30 | }); 31 | }); 32 | -------------------------------------------------------------------------------- /apps/dashboard/src/app/projects/projects-list/projects-list.component.ts: -------------------------------------------------------------------------------- 1 | 2 | import { Component, EventEmitter, Input, Output } from '@angular/core'; 3 | import { Project } from '@workshop/core-data'; 4 | 5 | @Component({ 6 | selector: 'app-projects-list', 7 | templateUrl: './projects-list.component.html', 8 | styleUrls: ['./projects-list.component.scss'] 9 | }) 10 | export class ProjectsListComponent { 11 | @Input() projects: Project[]; 12 | @Input() readonly = false; 13 | @Output() selected = new EventEmitter(); 14 | @Output() deleted = new EventEmitter(); 15 | } 16 | -------------------------------------------------------------------------------- /apps/dashboard/src/app/projects/projects-routing.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { Routes, RouterModule } from '@angular/router'; 3 | import { ProjectsComponent } from './projects.component'; 4 | 5 | const routes: Routes = [ 6 | { path: '', component: ProjectsComponent } 7 | ]; 8 | 9 | @NgModule({ 10 | imports: [RouterModule.forChild(routes)], 11 | exports: [RouterModule] 12 | }) 13 | export class ProjectsRoutingModule { } 14 | -------------------------------------------------------------------------------- /apps/dashboard/src/app/projects/projects.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |

{{primaryColor}}

4 | 8 | 9 |
10 | 11 |
12 | 16 | 17 |
18 |
19 | -------------------------------------------------------------------------------- /apps/dashboard/src/app/projects/projects.component.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onehungrymind/angular-core-workshop/f20badbfc54c3f3018b035e6187e482895cebb8f/apps/dashboard/src/app/projects/projects.component.scss -------------------------------------------------------------------------------- /apps/dashboard/src/app/projects/projects.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { HttpClientModule } from '@angular/common/http'; 2 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 3 | import { FormsModule } from '@angular/forms'; 4 | import { MaterialModule } from '@workshop/material'; 5 | 6 | import { ProjectDetailsComponent } from './project-details/project-details.component'; 7 | import { ProjectsListComponent } from './projects-list/projects-list.component'; 8 | import { ProjectsComponent } from './projects.component'; 9 | import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; 10 | import { DebugElement } from '@angular/core'; 11 | import { Project, ProjectsService } from '@workshop/core-data'; 12 | import { By } from '@angular/platform-browser'; 13 | import { noop } from 'rxjs'; 14 | 15 | describe('ProjectsComponent', () => { 16 | // Create my local test members 17 | let component: ProjectsComponent; 18 | let fixture: ComponentFixture; 19 | let de: DebugElement; 20 | let projectsService: ProjectsService; 21 | 22 | const mockProjectsService = { 23 | all() { return noop() } 24 | } 25 | const emptyProject: Project = { 26 | id: null, 27 | title: '', 28 | details: '', 29 | percentComplete: 0, 30 | approved: false, 31 | } 32 | 33 | 34 | // Instantiate test bed 35 | beforeEach(() => { 36 | fixture = TestBed.configureTestingModule({ 37 | declarations: [ 38 | ProjectsComponent, 39 | ProjectsListComponent, 40 | ProjectDetailsComponent 41 | ], 42 | providers: [{provide: ProjectsService, useValue: mockProjectsService}], 43 | imports: [ 44 | MaterialModule, 45 | FormsModule, 46 | HttpClientModule, 47 | BrowserAnimationsModule 48 | ] 49 | }).createComponent(ProjectsComponent); // Instantiate the fixture 50 | 51 | // Get THE component instance 52 | component = fixture.componentInstance; 53 | // Get the debug element aka the element the component lives on 54 | de = fixture.debugElement; 55 | // Get service instance 56 | projectsService = de.injector.get(ProjectsService); 57 | 58 | // Manually force change detection 59 | fixture.detectChanges(); 60 | 61 | }); 62 | 63 | it('should should have a primaryColor of `red`', () => { 64 | expect(component.primaryColor).toBe('red'); 65 | }); 66 | 67 | it('should select a project', () => { 68 | component.selectProject(emptyProject); 69 | expect(component.selectedProject).toBe(emptyProject); 70 | }); 71 | 72 | it('should display primaryColor', ()=> { 73 | const h1 = de.query(By.css('h1')); 74 | expect(h1.nativeElement.innerText).toBe('red'); 75 | }); 76 | 77 | it('should update h1 to new primaryColor', () => { 78 | const h1 = de.query(By.css('h1')); 79 | component.primaryColor = 'black'; 80 | fixture.detectChanges(); 81 | expect(h1.nativeElement.innerText).toBe('black'); 82 | }) 83 | 84 | }); 85 | -------------------------------------------------------------------------------- /apps/dashboard/src/app/projects/projects.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import { ProjectsService, Project } from '@workshop/core-data'; 3 | import { Observable } from 'rxjs'; 4 | @Component({ 5 | selector: 'app-projects', 6 | templateUrl: './projects.component.html', 7 | styleUrls: ['./projects.component.scss'] 8 | }) 9 | export class ProjectsComponent implements OnInit { 10 | primaryColor = 'red'; 11 | projects$; 12 | selectedProject: Project; 13 | 14 | constructor(private projectsService: ProjectsService) { 15 | } 16 | 17 | ngOnInit() { 18 | this.getProjects(); 19 | this.resetProject(); 20 | } 21 | 22 | selectProject(project) { 23 | this.selectedProject = project; 24 | } 25 | 26 | resetProject() { 27 | const emptyProject: Project = { 28 | id: null, 29 | title: '', 30 | details: '', 31 | percentComplete: 0, 32 | approved: false, 33 | } 34 | this.selectProject(emptyProject); 35 | } 36 | 37 | getProjects() { 38 | this.projects$ = this.projectsService.all(); 39 | } 40 | 41 | saveProject(project) { 42 | if(!project.id) { 43 | this.createProject(project); 44 | } else { 45 | this.updateProject(project); 46 | } 47 | } 48 | 49 | createProject(project) { 50 | this.projectsService.create(project) 51 | .subscribe(result => { 52 | this.getProjects(); 53 | this.resetProject(); 54 | }); 55 | } 56 | 57 | updateProject(project) { 58 | this.projectsService.update(project) 59 | .subscribe(result => { 60 | this.getProjects(); 61 | this.resetProject(); 62 | }); 63 | } 64 | 65 | deleteProject(project) { 66 | this.projectsService.delete(project.id) 67 | .subscribe(result => this.getProjects()); 68 | } 69 | 70 | cancel() { 71 | this.resetProject(); 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /apps/dashboard/src/app/projects/projects.module.spec.ts: -------------------------------------------------------------------------------- 1 | import { ProjectsModule } from './projects.module'; 2 | 3 | describe('ProjectsModule', () => { 4 | let projectsModule: ProjectsModule; 5 | 6 | beforeEach(() => { 7 | projectsModule = new ProjectsModule(); 8 | }); 9 | 10 | it('should create an instance', () => { 11 | expect(projectsModule).toBeTruthy(); 12 | }); 13 | }); 14 | -------------------------------------------------------------------------------- /apps/dashboard/src/app/projects/projects.module.ts: -------------------------------------------------------------------------------- 1 | import { MaterialModule } from '@workshop/material'; 2 | import { NgModule } from '@angular/core'; 3 | import { CommonModule } from '@angular/common'; 4 | 5 | import { ProjectsRoutingModule } from './projects-routing.module'; 6 | import { ProjectsComponent } from './projects.component'; 7 | import { FormsModule } from '@angular/forms'; 8 | import { ProjectsListComponent } from './projects-list/projects-list.component'; 9 | import { ProjectDetailsComponent } from './project-details/project-details.component'; 10 | 11 | @NgModule({ 12 | imports: [ 13 | CommonModule, 14 | ProjectsRoutingModule, 15 | MaterialModule, 16 | FormsModule 17 | ], 18 | declarations: [ 19 | ProjectsComponent, 20 | ProjectsListComponent, 21 | ProjectDetailsComponent 22 | ], 23 | exports: [ProjectsComponent] 24 | }) 25 | export class ProjectsModule { } 26 | -------------------------------------------------------------------------------- /apps/dashboard/src/assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onehungrymind/angular-core-workshop/f20badbfc54c3f3018b035e6187e482895cebb8f/apps/dashboard/src/assets/.gitkeep -------------------------------------------------------------------------------- /apps/dashboard/src/assets/background.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onehungrymind/angular-core-workshop/f20badbfc54c3f3018b035e6187e482895cebb8f/apps/dashboard/src/assets/background.jpg -------------------------------------------------------------------------------- /apps/dashboard/src/assets/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onehungrymind/angular-core-workshop/f20badbfc54c3f3018b035e6187e482895cebb8f/apps/dashboard/src/assets/logo.png -------------------------------------------------------------------------------- /apps/dashboard/src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true 3 | }; 4 | -------------------------------------------------------------------------------- /apps/dashboard/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 | -------------------------------------------------------------------------------- /apps/dashboard/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onehungrymind/angular-core-workshop/f20badbfc54c3f3018b035e6187e482895cebb8f/apps/dashboard/src/favicon.ico -------------------------------------------------------------------------------- /apps/dashboard/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Dashboard 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /apps/dashboard/src/main.ts: -------------------------------------------------------------------------------- 1 | import 'hammerjs'; 2 | import { enableProdMode } from '@angular/core'; 3 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 4 | 5 | import { AppModule } from './app/app.module'; 6 | import { environment } from './environments/environment'; 7 | 8 | if (environment.production) { 9 | enableProdMode(); 10 | } 11 | 12 | platformBrowserDynamic() 13 | .bootstrapModule(AppModule) 14 | .catch(err => console.error(err)); 15 | -------------------------------------------------------------------------------- /apps/dashboard/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 | /** Evergreen browsers require these. **/ 44 | // Used for reflect-metadata in JIT. If you use AOT (and only Angular decorators), you can remove. 45 | 46 | 47 | /** 48 | * Web Animations `@angular/platform-browser/animations` 49 | * Only required if AnimationBuilder is used within the application and using IE/Edge or Safari. 50 | * Standard animation support in Angular DOES NOT require any polyfills (as of Angular 6.0). 51 | **/ 52 | // import 'web-animations-js'; // Run `npm install --save web-animations-js`. 53 | 54 | /** 55 | * By default, zone.js will patch all possible macroTask and DomEvents 56 | * user can disable parts of macroTask/DomEvents patch by setting following flags 57 | */ 58 | 59 | // (window as any).__Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame 60 | // (window as any).__Zone_disable_on_property = true; // disable patch onProperty such as onclick 61 | // (window as any).__zone_symbol__BLACK_LISTED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames 62 | 63 | /* 64 | * in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js 65 | * with the following flag, it will bypass `zone.js` patch for IE/Edge 66 | */ 67 | // (window as any).__Zone_enable_cross_context_check = true; 68 | 69 | /*************************************************************************************************** 70 | * Zone JS is required by default for Angular itself. 71 | */ 72 | import 'zone.js/dist/zone'; // Included with Angular CLI. 73 | 74 | /*************************************************************************************************** 75 | * APPLICATION IMPORTS 76 | */ 77 | -------------------------------------------------------------------------------- /apps/dashboard/src/styles.scss: -------------------------------------------------------------------------------- 1 | @import '~@angular/material/prebuilt-themes/deeppurple-amber.css'; 2 | html { 3 | height: 100%; 4 | } 5 | 6 | body { 7 | margin: 0; 8 | font-family: Roboto, sans-serif; 9 | height: 100%; 10 | display: flex; 11 | } 12 | 13 | p { 14 | margin: 16px; 15 | } 16 | 17 | .icon-20 { 18 | font-size: 20px; 19 | } 20 | 21 | * { 22 | -webkit-font-smoothing: antialiased; 23 | -moz-osx-font-smoothing: grayscale; 24 | } 25 | 26 | .container { 27 | display: flex; 28 | margin: 10px; 29 | flex-wrap: wrap; 30 | } 31 | 32 | .container [class*='col'] { 33 | padding: 10px; 34 | flex: 1; 35 | } 36 | 37 | .mat-card-header-text { 38 | margin-left: 0; 39 | border-bottom: 1px solid #ffd740; 40 | } 41 | 42 | .header { 43 | padding-bottom: 10px; 44 | color: #673ab7; 45 | border-bottom: 2px solid #673ab7; 46 | } 47 | 48 | app-root { 49 | display: flex; 50 | flex-direction: column; 51 | flex: 1; 52 | } 53 | 54 | mat-toolbar { 55 | box-shadow: 0 3px 5px -1px rgba(0, 0, 0, 0.2), 56 | 0 6px 10px 0 rgba(0, 0, 0, 0.14), 0 1px 18px 0 rgba(0, 0, 0, 0.12); 57 | z-index: 1; 58 | } 59 | 60 | mat-sidenav { 61 | box-shadow: 3px 0 6px rgba(0, 0, 0, 0.24); 62 | width: 200px; 63 | } 64 | 65 | mat-card:not(.dashboard-card) { 66 | margin-bottom: 20px; 67 | } 68 | 69 | .mat-sidenav-container { 70 | background: #f5f5f5; 71 | flex: 1; 72 | } 73 | 74 | .fill-remaining-space { 75 | flex: 1 1 auto; 76 | } 77 | 78 | .full-width { 79 | width: 100%; 80 | } 81 | 82 | .dashboard-card { 83 | position: absolute !important; 84 | top: 15px; 85 | left: 15px; 86 | right: 15px; 87 | bottom: 15px; 88 | mat-card-header { 89 | justify-content: center; 90 | } 91 | } 92 | 93 | .dashboard-card-content { 94 | text-align: center; 95 | } 96 | 97 | .more-button { 98 | position: absolute; 99 | top: 5px; 100 | right: 10px; 101 | } 102 | 103 | .grid-container { 104 | margin: 20px; 105 | } 106 | 107 | .list-container { 108 | margin: 20px; 109 | .full-width-table { 110 | width: 100%; 111 | } 112 | tr { 113 | -webkit-transition: background-color 300ms; 114 | -moz-transition: background-color 300ms; 115 | -ms-transition: background-color 300ms; 116 | -o-transition: background-color 300ms; 117 | transition: background-color 300ms; 118 | } 119 | tr:not(.mat-header-row):hover { 120 | background: whitesmoke; 121 | cursor: pointer; 122 | } 123 | } 124 | 125 | .details-container { 126 | mat-form-field { 127 | width: 100%; 128 | } 129 | mat-card-header { 130 | display: flex; 131 | justify-content: space-between; 132 | align-items: center; 133 | } 134 | } 135 | 136 | mat-list-item:not(:first-of-type) { 137 | border-top: 1px solid #efefef; 138 | } 139 | 140 | mat-form-field { 141 | width: 100%; 142 | } 143 | 144 | mat-list-item:hover { 145 | cursor: pointer; 146 | background: whitesmoke; 147 | } 148 | 149 | mat-list-item:not(:first-of-type) { 150 | border-top: 1px solid #efefef; 151 | } 152 | 153 | .symbol { 154 | color: #777; 155 | } 156 | 157 | mat-card-actions { 158 | margin-bottom: 0; 159 | } 160 | 161 | .full-width { 162 | width: 100%; 163 | } 164 | 165 | .nav-link { 166 | color: rgba(0, 0, 0, 0.54); 167 | display: flex !important; 168 | align-items: center; 169 | padding-top: 5px; 170 | padding-bottom: 5px; 171 | } 172 | 173 | // UI LOGIN 174 | ui-login { 175 | height: 100%; 176 | .background { 177 | position: fixed; 178 | left: 0; 179 | right: 0; 180 | z-index: 1; 181 | display: block; 182 | background: url(assets/background.jpg) no-repeat center center fixed; 183 | background-size: cover; 184 | height: 100%; 185 | overflow: hidden; 186 | } 187 | .container { 188 | position: fixed; 189 | left: 0; 190 | right: 0; 191 | top: 0; 192 | bottom: 0; 193 | z-index: 100; 194 | .card-wrapper { 195 | margin: auto; 196 | display: flex; 197 | justify-content: center; 198 | } 199 | } 200 | mat-card { 201 | box-shadow: 0 3px 5px -1px rgba(0, 0, 0, 0.2), 202 | 0 6px 10px 0 rgba(0, 0, 0, 0.14), 0 1px 18px 0 rgba(0, 0, 0, 0.12); 203 | mat-card-header { 204 | margin-bottom: 10px; 205 | } 206 | mat-form-field { 207 | width: 100%; 208 | } 209 | } 210 | .ig-xpro2 { 211 | -webkit-filter: contrast(1.3) brightness(0.8) sepia(0.3) saturate(1.5) 212 | hue-rotate(-20deg); 213 | filter: contrast(1.3) brightness(0.8) sepia(0.3) saturate(1.5) 214 | hue-rotate(-20deg); 215 | } 216 | .ig-willow { 217 | -webkit-filter: saturate(0.02) contrast(0.85) brightness(1.2) sepia(0.02); 218 | filter: saturate(0.02) contrast(0.85) brightness(1.2) sepia(0.02); 219 | } 220 | .ig-walden { 221 | -webkit-filter: sepia(0.35) contrast(0.9) brightness(1.1) hue-rotate(-10deg) 222 | saturate(1.5); 223 | filter: sepia(0.35) contrast(0.9) brightness(1.1) hue-rotate(-10deg) 224 | saturate(1.5); 225 | } 226 | .ig-valencia { 227 | -webkit-filter: sepia(0.15) saturate(1.5) contrast(0.9); 228 | filter: sepia(0.15) saturate(1.5) contrast(0.9); 229 | } 230 | .ig-toaster { 231 | -webkit-filter: sepia(0.4) saturate(2.5) hue-rotate(-30deg) contrast(0.67); 232 | -filter: sepia(0.4) saturate(2.5) hue-rotate(-30deg) contrast(0.67); 233 | } 234 | .ig-sutro { 235 | -webkit-filter: brightness(0.75) contrast(1.3) sepia(0.5) hue-rotate(-25deg); 236 | filter: brightness(0.75) contrast(1.3) sepia(0.5) hue-rotate(-25deg); 237 | } 238 | .ig-sierra { 239 | -webkit-filter: contrast(0.8) saturate(1.2) sepia(0.15); 240 | filter: contrast(0.8) saturate(1.2) sepia(0.15); 241 | } 242 | .ig-rise { 243 | -webkit-filter: saturate(1.4) sepia(0.25) hue-rotate(-15deg) contrast(0.8) 244 | brightness(1.1); 245 | filter: saturate(1.4) sepia(0.25) hue-rotate(-15deg) contrast(0.8) 246 | brightness(1.1); 247 | } 248 | .ig-nashville { 249 | -webkit-filter: sepia(0.4) saturate(1.5) contrast(0.9) brightness(1.1) 250 | hue-rotate(-15deg); 251 | filter: sepia(0.4) saturate(1.5) contrast(0.9) brightness(1.1) 252 | hue-rotate(-15deg); 253 | } 254 | .ig-mayfair { 255 | -webkit-filter: saturate(1.4) contrast(1.1); 256 | filter: saturate(1.4) contrast(1.1); 257 | } 258 | .ig-lofi { 259 | filter: contrast(1.4) brightness(0.9) sepia(0.05); 260 | -webkit-filter: contrast(1.4) brightness(0.9) sepia(0.05); 261 | } 262 | .ig-kelvin { 263 | filter: sepia(0.4) saturate(2.4) brightness(1.3) contrast(1); 264 | -webkit-filter: sepia(0.4) saturate(2.4) brightness(1.3) contrast(1); 265 | } 266 | .ig-inkwell { 267 | -webkit-filter: grayscale(1) brightness(1.2) contrast(1.05); 268 | filter: grayscale(1) brightness(1.2) contrast(1.05); 269 | } 270 | .ig-hudson { 271 | -webkit-filter: contrast(1.2) brightness(0.9) hue-rotate(-10deg); 272 | filter: contrast(1.2) brightness(0.9) hue-rotate(-10deg); 273 | } 274 | .hefe { 275 | -webkit-filter: contrast(1.3) sepia(0.3) saturate(1.3) hue-rotate(-10deg) 276 | brightness(0.95); 277 | filter: contrast(1.3) sepia(0.3) saturate(1.3) hue-rotate(-10deg) 278 | brightness(0.95); 279 | } 280 | .ig-earlybird { 281 | -webkit-filter: sepia(0.4) saturate(1.6) contrast(1.1) brightness(0.9) 282 | hue-rotate(-10deg); 283 | filter: sepia(0.4) saturate(1.6) contrast(1.1) brightness(0.9) 284 | hue-rotate(-10deg); 285 | } 286 | .ig-brannan { 287 | -webkit-filter: sepia(0.5) contrast(1.4); 288 | filter: sepia(0.5) contrast(1.4); 289 | } 290 | .ig-amaro { 291 | -webkit-filter: hue-rotate(-10deg) contrast(0.9) brightness(1.1) 292 | saturate(1.5); 293 | filter: hue-rotate(-10deg) contrast(0.9) brightness(1.1) saturate(1.5); 294 | } 295 | .ig-1977 { 296 | -webkit-filter: sepia(0.5) hue-rotate(-30deg) saturate(1.2) contrast(0.8); 297 | filter: sepia(0.5) hue-rotate(-30deg) saturate(1.2) contrast(0.8); 298 | } 299 | } 300 | 301 | // UI TOOLBAR 302 | mat-toolbar { 303 | box-shadow: 0 3px 5px -1px rgba(0, 0, 0, 0.2), 304 | 0 6px 10px 0 rgba(0, 0, 0, 0.14), 0 1px 18px 0 rgba(0, 0, 0, 0.12); 305 | z-index: 900; 306 | > .mat-mini-fab { 307 | margin-right: 10px; 308 | } 309 | .spacer { 310 | flex: 1 1 auto; 311 | } 312 | .title { 313 | vertical-align: middle; 314 | } 315 | .logo { 316 | margin-left: 20px; 317 | img { 318 | vertical-align: middle; 319 | width: 100px; 320 | height: auto; 321 | } 322 | } 323 | } 324 | -------------------------------------------------------------------------------- /apps/dashboard/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 | -------------------------------------------------------------------------------- /apps/dashboard/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../dist/out-tsc", 5 | "types": [] 6 | }, 7 | "exclude": ["src/test.ts", "**/*.spec.ts"], 8 | "include": ["**/*.ts"] 9 | } 10 | -------------------------------------------------------------------------------- /apps/dashboard/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "types": ["jasmine", "node"] 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /apps/dashboard/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../dist/out-tsc", 5 | "types": ["jasmine", "node"] 6 | }, 7 | "files": ["src/test.ts", "src/polyfills.ts"], 8 | "include": ["**/*.spec.ts", "**/*.d.ts"] 9 | } 10 | -------------------------------------------------------------------------------- /apps/dashboard/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 | -------------------------------------------------------------------------------- /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 | const { join } = require('path'); 5 | const { constants } = require('karma'); 6 | 7 | module.exports = () => { 8 | return { 9 | basePath: '', 10 | frameworks: ['jasmine', '@angular-devkit/build-angular'], 11 | plugins: [ 12 | require('karma-jasmine'), 13 | require('karma-chrome-launcher'), 14 | require('karma-jasmine-html-reporter'), 15 | require('karma-coverage-istanbul-reporter'), 16 | require('@angular-devkit/build-angular/plugins/karma') 17 | ], 18 | client: { 19 | clearContext: false // leave Jasmine Spec Runner output visible in browser 20 | }, 21 | coverageIstanbulReporter: { 22 | dir: join(__dirname, '../../coverage'), 23 | reports: ['html', 'lcovonly'], 24 | fixWebpackSourcePaths: true 25 | }, 26 | reporters: ['progress', 'kjhtml'], 27 | port: 9876, 28 | colors: true, 29 | logLevel: constants.LOG_INFO, 30 | autoWatch: true, 31 | browsers: ['Chrome'], 32 | singleRun: false 33 | }; 34 | }; 35 | -------------------------------------------------------------------------------- /libs/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onehungrymind/angular-core-workshop/f20badbfc54c3f3018b035e6187e482895cebb8f/libs/.gitkeep -------------------------------------------------------------------------------- /libs/core-data/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 | const { join } = require('path'); 5 | const getBaseKarmaConfig = require('../../karma.conf'); 6 | 7 | module.exports = function(config) { 8 | const baseConfig = getBaseKarmaConfig(); 9 | config.set({ 10 | ...baseConfig, 11 | coverageIstanbulReporter: { 12 | ...baseConfig.coverageIstanbulReporter, 13 | dir: join(__dirname, '../../coverage/libs/core-data') 14 | } 15 | }); 16 | }; 17 | -------------------------------------------------------------------------------- /libs/core-data/src/index.ts: -------------------------------------------------------------------------------- 1 | export { CoreDataModule } from './lib/core-data.module'; 2 | export { Project } from './lib/projects/project'; 3 | export { ProjectsService } from './lib/projects/projects.service'; 4 | 5 | -------------------------------------------------------------------------------- /libs/core-data/src/lib/core-data.module.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, TestBed } from '@angular/core/testing'; 2 | import { CoreDataModule } from './core-data.module'; 3 | 4 | describe('CoreDataModule', () => { 5 | beforeEach(async(() => { 6 | TestBed.configureTestingModule({ 7 | imports: [CoreDataModule] 8 | }).compileComponents(); 9 | })); 10 | 11 | it('should create', () => { 12 | expect(CoreDataModule).toBeDefined(); 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /libs/core-data/src/lib/core-data.module.ts: -------------------------------------------------------------------------------- 1 | import { CommonModule } from '@angular/common'; 2 | import { HttpClientModule } from '@angular/common/http'; 3 | import { NgModule } from '@angular/core'; 4 | import { ProjectsService } from './projects/projects.service'; 5 | 6 | @NgModule({ 7 | imports: [ 8 | CommonModule, 9 | HttpClientModule 10 | ], 11 | providers: [ 12 | ProjectsService 13 | ] 14 | }) 15 | export class CoreDataModule { } 16 | -------------------------------------------------------------------------------- /libs/core-data/src/lib/projects/project.ts: -------------------------------------------------------------------------------- 1 | export interface Project { 2 | id: string; 3 | title: string; 4 | details: string; 5 | percentComplete: number, 6 | approved: boolean, 7 | } 8 | -------------------------------------------------------------------------------- /libs/core-data/src/lib/projects/projects.service.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed } from '@angular/core/testing'; 2 | 3 | import { ProjectsService } from './projects.service'; 4 | 5 | describe('ProjectsService', () => { 6 | beforeEach(() => TestBed.configureTestingModule({})); 7 | 8 | it('should be created', () => { 9 | const service: ProjectsService = TestBed.get(ProjectsService); 10 | expect(service).toBeTruthy(); 11 | }); 12 | }); 13 | -------------------------------------------------------------------------------- /libs/core-data/src/lib/projects/projects.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | import { HttpClient } from '@angular/common/http'; 3 | 4 | const BASE_URL = 'http://localhost:3000/'; 5 | 6 | @Injectable({ 7 | providedIn: 'root' 8 | }) 9 | export class ProjectsService { 10 | model = 'projects'; 11 | 12 | constructor(private httpClient: HttpClient) { } 13 | 14 | getUrl() { 15 | return `${BASE_URL}${this.model}`; 16 | } 17 | 18 | getUrlForId(id) { 19 | return `${this.getUrl()}/${id}`; 20 | } 21 | 22 | all() { 23 | return this.httpClient.get(this.getUrl()); 24 | } 25 | 26 | create(project) { 27 | return this.httpClient.post(this.getUrl(), project); 28 | } 29 | 30 | update(project) { 31 | return this.httpClient.patch(this.getUrlForId(project.id), project); 32 | } 33 | 34 | delete(projectId) { 35 | return this.httpClient.delete(this.getUrlForId(projectId)); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /libs/core-data/src/test.ts: -------------------------------------------------------------------------------- 1 | // This file is required by karma.conf.js and loads recursively all the .spec and framework files 2 | 3 | import 'core-js/es7/reflect'; 4 | import 'zone.js/dist/zone'; 5 | import 'zone.js/dist/zone-testing'; 6 | import { getTestBed } from '@angular/core/testing'; 7 | import { 8 | BrowserDynamicTestingModule, 9 | platformBrowserDynamicTesting 10 | } from '@angular/platform-browser-dynamic/testing'; 11 | 12 | declare const require: any; 13 | 14 | // First, initialize the Angular testing environment. 15 | getTestBed().initTestEnvironment( 16 | BrowserDynamicTestingModule, 17 | platformBrowserDynamicTesting() 18 | ); 19 | // Then we find all the tests. 20 | const context = require.context('./', true, /\.spec\.ts$/); 21 | // And load the modules. 22 | context.keys().map(context); 23 | -------------------------------------------------------------------------------- /libs/core-data/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "types": ["jasmine", "node"] 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /libs/core-data/tsconfig.lib.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../dist/out-tsc", 5 | "target": "es2015", 6 | "module": "es2015", 7 | "moduleResolution": "node", 8 | "declaration": true, 9 | "sourceMap": true, 10 | "inlineSources": true, 11 | "emitDecoratorMetadata": true, 12 | "experimentalDecorators": true, 13 | "importHelpers": true, 14 | "types": [], 15 | "lib": ["dom", "es2015"] 16 | }, 17 | "angularCompilerOptions": { 18 | "annotateForClosureCompiler": true, 19 | "skipTemplateCodegen": true, 20 | "strictMetadataEmit": true, 21 | "fullTemplateTypeCheck": true, 22 | "strictInjectionParameters": true, 23 | "enableResourceInlining": true 24 | }, 25 | "exclude": ["src/test.ts", "**/*.spec.ts"] 26 | } 27 | -------------------------------------------------------------------------------- /libs/core-data/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../dist/out-tsc", 5 | "types": ["jasmine", "node"] 6 | }, 7 | "files": ["src/test.ts"], 8 | "include": ["**/*.spec.ts", "**/*.d.ts"] 9 | } 10 | -------------------------------------------------------------------------------- /libs/core-data/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tslint.json", 3 | "rules": { 4 | "directive-selector": [ 5 | true, 6 | "attribute", 7 | "workshop", 8 | "camelCase" 9 | ], 10 | "component-selector": [ 11 | true, 12 | "element", 13 | "workshop", 14 | "kebab-case" 15 | ] 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /libs/material/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 | const { join } = require('path'); 5 | const getBaseKarmaConfig = require('../../karma.conf'); 6 | 7 | module.exports = function(config) { 8 | const baseConfig = getBaseKarmaConfig(); 9 | config.set({ 10 | ...baseConfig, 11 | coverageIstanbulReporter: { 12 | ...baseConfig.coverageIstanbulReporter, 13 | dir: join(__dirname, '../../coverage/libs/material') 14 | } 15 | }); 16 | }; 17 | -------------------------------------------------------------------------------- /libs/material/src/index.ts: -------------------------------------------------------------------------------- 1 | export { MaterialModule } from './lib/material.module'; 2 | -------------------------------------------------------------------------------- /libs/material/src/lib/material.module.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, TestBed } from '@angular/core/testing'; 2 | import { MaterialModule } from './material.module'; 3 | 4 | describe('MaterialModule', () => { 5 | beforeEach(async(() => { 6 | TestBed.configureTestingModule({ 7 | imports: [MaterialModule] 8 | }).compileComponents(); 9 | })); 10 | 11 | it('should create', () => { 12 | expect(MaterialModule).toBeDefined(); 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /libs/material/src/lib/material.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { MatButtonModule } from '@angular/material/button'; 3 | import { MatButtonToggleModule } from '@angular/material/button-toggle'; 4 | import { MatCardModule } from '@angular/material/card'; 5 | import { MatCheckboxModule } from '@angular/material/checkbox'; 6 | import { MatFormFieldModule } from '@angular/material/form-field'; 7 | import { MatGridListModule } from '@angular/material/grid-list'; 8 | import { MatIconModule } from '@angular/material/icon'; 9 | import { MatInputModule } from '@angular/material/input'; 10 | import { MatListModule } from '@angular/material/list'; 11 | import { MatMenuModule } from '@angular/material/menu'; 12 | import { MatSelectModule } from '@angular/material/select'; 13 | import { MatSidenavModule } from '@angular/material/sidenav'; 14 | import { MatSliderModule } from '@angular/material/slider'; 15 | import { MatSnackBarModule } from '@angular/material/snack-bar'; 16 | import { MatTableModule } from '@angular/material/table'; 17 | import { MatToolbarModule } from '@angular/material/toolbar'; 18 | 19 | @NgModule({ 20 | imports: [ 21 | MatButtonModule, 22 | MatCardModule, 23 | MatCheckboxModule, 24 | MatFormFieldModule, 25 | MatGridListModule, 26 | MatIconModule, 27 | MatInputModule, 28 | MatListModule, 29 | MatMenuModule, 30 | MatSelectModule, 31 | MatSidenavModule, 32 | MatSliderModule, 33 | MatSnackBarModule, 34 | MatTableModule, 35 | MatToolbarModule, 36 | MatButtonToggleModule 37 | ], 38 | exports: [ 39 | MatButtonModule, 40 | MatCardModule, 41 | MatCheckboxModule, 42 | MatFormFieldModule, 43 | MatGridListModule, 44 | MatIconModule, 45 | MatInputModule, 46 | MatListModule, 47 | MatMenuModule, 48 | MatSelectModule, 49 | MatSidenavModule, 50 | MatSliderModule, 51 | MatSnackBarModule, 52 | MatTableModule, 53 | MatToolbarModule, 54 | MatButtonToggleModule 55 | ] 56 | }) 57 | export class MaterialModule {} 58 | -------------------------------------------------------------------------------- /libs/material/src/test.ts: -------------------------------------------------------------------------------- 1 | // This file is required by karma.conf.js and loads recursively all the .spec and framework files 2 | 3 | import 'core-js/es7/reflect'; 4 | import 'zone.js/dist/zone'; 5 | import 'zone.js/dist/zone-testing'; 6 | import { getTestBed } from '@angular/core/testing'; 7 | import { 8 | BrowserDynamicTestingModule, 9 | platformBrowserDynamicTesting 10 | } from '@angular/platform-browser-dynamic/testing'; 11 | 12 | declare const require: any; 13 | 14 | // First, initialize the Angular testing environment. 15 | getTestBed().initTestEnvironment( 16 | BrowserDynamicTestingModule, 17 | platformBrowserDynamicTesting() 18 | ); 19 | // Then we find all the tests. 20 | const context = require.context('./', true, /\.spec\.ts$/); 21 | // And load the modules. 22 | context.keys().map(context); 23 | -------------------------------------------------------------------------------- /libs/material/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "types": ["jasmine", "node"] 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /libs/material/tsconfig.lib.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../dist/out-tsc", 5 | "target": "es2015", 6 | "module": "es2015", 7 | "moduleResolution": "node", 8 | "declaration": true, 9 | "sourceMap": true, 10 | "inlineSources": true, 11 | "emitDecoratorMetadata": true, 12 | "experimentalDecorators": true, 13 | "importHelpers": true, 14 | "types": [], 15 | "lib": ["dom", "es2015"] 16 | }, 17 | "angularCompilerOptions": { 18 | "annotateForClosureCompiler": true, 19 | "skipTemplateCodegen": true, 20 | "strictMetadataEmit": true, 21 | "fullTemplateTypeCheck": true, 22 | "strictInjectionParameters": true, 23 | "enableResourceInlining": true 24 | }, 25 | "exclude": ["src/test.ts", "**/*.spec.ts"] 26 | } 27 | -------------------------------------------------------------------------------- /libs/material/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../dist/out-tsc", 5 | "types": ["jasmine", "node"] 6 | }, 7 | "files": ["src/test.ts"], 8 | "include": ["**/*.spec.ts", "**/*.d.ts"] 9 | } 10 | -------------------------------------------------------------------------------- /libs/material/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tslint.json", 3 | "rules": { 4 | "directive-selector": [ 5 | true, 6 | "attribute", 7 | "workshop", 8 | "camelCase" 9 | ], 10 | "component-selector": [ 11 | true, 12 | "element", 13 | "workshop", 14 | "kebab-case" 15 | ] 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /libs/ui-login/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 | const { join } = require('path'); 5 | const getBaseKarmaConfig = require('../../karma.conf'); 6 | 7 | module.exports = function(config) { 8 | const baseConfig = getBaseKarmaConfig(); 9 | config.set({ 10 | ...baseConfig, 11 | coverageIstanbulReporter: { 12 | ...baseConfig.coverageIstanbulReporter, 13 | dir: join(__dirname, '../../coverage/libs/ui-login') 14 | } 15 | }); 16 | }; 17 | -------------------------------------------------------------------------------- /libs/ui-login/src/index.ts: -------------------------------------------------------------------------------- 1 | export { LoginComponent } from './lib/login/login.component'; 2 | export { UiLoginModule } from './lib/ui-login.module'; 3 | -------------------------------------------------------------------------------- /libs/ui-login/src/lib/login/login.component.html: -------------------------------------------------------------------------------- 1 |

2 | login works! 3 |

4 | -------------------------------------------------------------------------------- /libs/ui-login/src/lib/login/login.component.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onehungrymind/angular-core-workshop/f20badbfc54c3f3018b035e6187e482895cebb8f/libs/ui-login/src/lib/login/login.component.scss -------------------------------------------------------------------------------- /libs/ui-login/src/lib/login/login.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { LoginComponent } from './login.component'; 4 | 5 | describe('LoginComponent', () => { 6 | let component: LoginComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ LoginComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(LoginComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /libs/ui-login/src/lib/login/login.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'ui-login', 5 | templateUrl: './login.component.html', 6 | styleUrls: ['./login.component.scss'] 7 | }) 8 | export class LoginComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /libs/ui-login/src/lib/ui-login.module.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, TestBed } from '@angular/core/testing'; 2 | import { UiLoginModule } from './ui-login.module'; 3 | 4 | describe('UiLoginModule', () => { 5 | beforeEach(async(() => { 6 | TestBed.configureTestingModule({ 7 | imports: [UiLoginModule] 8 | }).compileComponents(); 9 | })); 10 | 11 | it('should create', () => { 12 | expect(UiLoginModule).toBeDefined(); 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /libs/ui-login/src/lib/ui-login.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { CommonModule } from '@angular/common'; 3 | import { LoginComponent } from './login/login.component'; 4 | 5 | @NgModule({ 6 | imports: [CommonModule], 7 | declarations: [LoginComponent], 8 | exports: [LoginComponent] 9 | }) 10 | export class UiLoginModule {} 11 | -------------------------------------------------------------------------------- /libs/ui-login/src/test.ts: -------------------------------------------------------------------------------- 1 | // This file is required by karma.conf.js and loads recursively all the .spec and framework files 2 | 3 | import 'core-js/es7/reflect'; 4 | import 'zone.js/dist/zone'; 5 | import 'zone.js/dist/zone-testing'; 6 | import { getTestBed } from '@angular/core/testing'; 7 | import { 8 | BrowserDynamicTestingModule, 9 | platformBrowserDynamicTesting 10 | } from '@angular/platform-browser-dynamic/testing'; 11 | 12 | declare const require: any; 13 | 14 | // First, initialize the Angular testing environment. 15 | getTestBed().initTestEnvironment( 16 | BrowserDynamicTestingModule, 17 | platformBrowserDynamicTesting() 18 | ); 19 | // Then we find all the tests. 20 | const context = require.context('./', true, /\.spec\.ts$/); 21 | // And load the modules. 22 | context.keys().map(context); 23 | -------------------------------------------------------------------------------- /libs/ui-login/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "types": ["jasmine", "node"] 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /libs/ui-login/tsconfig.lib.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../dist/out-tsc", 5 | "target": "es2015", 6 | "module": "es2015", 7 | "moduleResolution": "node", 8 | "declaration": true, 9 | "sourceMap": true, 10 | "inlineSources": true, 11 | "emitDecoratorMetadata": true, 12 | "experimentalDecorators": true, 13 | "importHelpers": true, 14 | "types": [], 15 | "lib": ["dom", "es2015"] 16 | }, 17 | "angularCompilerOptions": { 18 | "annotateForClosureCompiler": true, 19 | "skipTemplateCodegen": true, 20 | "strictMetadataEmit": true, 21 | "fullTemplateTypeCheck": true, 22 | "strictInjectionParameters": true, 23 | "enableResourceInlining": true 24 | }, 25 | "exclude": ["src/test.ts", "**/*.spec.ts"] 26 | } 27 | -------------------------------------------------------------------------------- /libs/ui-login/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../dist/out-tsc", 5 | "types": ["jasmine", "node"] 6 | }, 7 | "files": ["src/test.ts"], 8 | "include": ["**/*.spec.ts", "**/*.d.ts"] 9 | } 10 | -------------------------------------------------------------------------------- /libs/ui-login/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tslint.json", 3 | "rules": { 4 | "directive-selector": [ 5 | true, 6 | "attribute", 7 | "ui", 8 | "camelCase" 9 | ], 10 | "component-selector": [ 11 | true, 12 | "element", 13 | "ui", 14 | "kebab-case" 15 | ] 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /libs/ui-toolbar/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 | const { join } = require('path'); 5 | const getBaseKarmaConfig = require('../../karma.conf'); 6 | 7 | module.exports = function(config) { 8 | const baseConfig = getBaseKarmaConfig(); 9 | config.set({ 10 | ...baseConfig, 11 | coverageIstanbulReporter: { 12 | ...baseConfig.coverageIstanbulReporter, 13 | dir: join(__dirname, '../../coverage/libs/ui-toolbar') 14 | } 15 | }); 16 | }; 17 | -------------------------------------------------------------------------------- /libs/ui-toolbar/src/index.ts: -------------------------------------------------------------------------------- 1 | export * from './lib/ui-toolbar.module'; 2 | -------------------------------------------------------------------------------- /libs/ui-toolbar/src/lib/ui-toolbar.module.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, TestBed } from '@angular/core/testing'; 2 | import { UiToolbarModule } from './ui-toolbar.module'; 3 | 4 | describe('UiToolbarModule', () => { 5 | beforeEach(async(() => { 6 | TestBed.configureTestingModule({ 7 | imports: [UiToolbarModule] 8 | }).compileComponents(); 9 | })); 10 | 11 | it('should create', () => { 12 | expect(UiToolbarModule).toBeDefined(); 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /libs/ui-toolbar/src/lib/ui-toolbar.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { CommonModule } from '@angular/common'; 3 | 4 | @NgModule({ 5 | imports: [CommonModule] 6 | }) 7 | export class UiToolbarModule {} 8 | -------------------------------------------------------------------------------- /libs/ui-toolbar/src/test.ts: -------------------------------------------------------------------------------- 1 | // This file is required by karma.conf.js and loads recursively all the .spec and framework files 2 | 3 | import 'core-js/es7/reflect'; 4 | import 'zone.js/dist/zone'; 5 | import 'zone.js/dist/zone-testing'; 6 | import { getTestBed } from '@angular/core/testing'; 7 | import { 8 | BrowserDynamicTestingModule, 9 | platformBrowserDynamicTesting 10 | } from '@angular/platform-browser-dynamic/testing'; 11 | 12 | declare const require: any; 13 | 14 | // First, initialize the Angular testing environment. 15 | getTestBed().initTestEnvironment( 16 | BrowserDynamicTestingModule, 17 | platformBrowserDynamicTesting() 18 | ); 19 | // Then we find all the tests. 20 | const context = require.context('./', true, /\.spec\.ts$/); 21 | // And load the modules. 22 | context.keys().map(context); 23 | -------------------------------------------------------------------------------- /libs/ui-toolbar/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "types": ["jasmine", "node"] 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /libs/ui-toolbar/tsconfig.lib.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../dist/out-tsc", 5 | "target": "es2015", 6 | "module": "es2015", 7 | "moduleResolution": "node", 8 | "declaration": true, 9 | "sourceMap": true, 10 | "inlineSources": true, 11 | "emitDecoratorMetadata": true, 12 | "experimentalDecorators": true, 13 | "importHelpers": true, 14 | "types": [], 15 | "lib": ["dom", "es2015"] 16 | }, 17 | "angularCompilerOptions": { 18 | "annotateForClosureCompiler": true, 19 | "skipTemplateCodegen": true, 20 | "strictMetadataEmit": true, 21 | "fullTemplateTypeCheck": true, 22 | "strictInjectionParameters": true, 23 | "enableResourceInlining": true 24 | }, 25 | "exclude": ["src/test.ts", "**/*.spec.ts"] 26 | } 27 | -------------------------------------------------------------------------------- /libs/ui-toolbar/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../dist/out-tsc", 5 | "types": ["jasmine", "node"] 6 | }, 7 | "files": ["src/test.ts"], 8 | "include": ["**/*.spec.ts", "**/*.d.ts"] 9 | } 10 | -------------------------------------------------------------------------------- /libs/ui-toolbar/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tslint.json", 3 | "rules": { 4 | "directive-selector": [ 5 | true, 6 | "attribute", 7 | "ui", 8 | "camelCase" 9 | ], 10 | "component-selector": [ 11 | true, 12 | "element", 13 | "ui", 14 | "kebab-case" 15 | ] 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /nx.json: -------------------------------------------------------------------------------- 1 | { 2 | "npmScope": "workshop", 3 | "implicitDependencies": { 4 | "angular.json": "*", 5 | "package.json": "*", 6 | "tsconfig.json": "*", 7 | "tslint.json": "*", 8 | "nx.json": "*" 9 | }, 10 | "projects": { 11 | "dashboard": { 12 | "tags": [] 13 | }, 14 | "dashboard-e2e": { 15 | "tags": [] 16 | }, 17 | "material": { 18 | "tags": [] 19 | }, 20 | "core-data": { 21 | "tags": [] 22 | }, 23 | "ui-login": { 24 | "tags": [] 25 | }, 26 | "ui-toolbar": { 27 | "tags": [] 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "angular-core-workshop", 3 | "version": "0.0.0", 4 | "license": "MIT", 5 | "scripts": { 6 | "ng": "ng", 7 | "start": "ng serve", 8 | "server:all": "concurrently \"npm run server\" \"ng serve\"", 9 | "server": "json-server server/db.json", 10 | "server:auth": "node server/server.js", 11 | "build": "ng build", 12 | "test": "ng test", 13 | "lint": "./node_modules/.bin/nx workspace-lint && ng lint", 14 | "e2e": "ng e2e", 15 | "affected:apps": "./node_modules/.bin/nx affected:apps", 16 | "affected:libs": "./node_modules/.bin/nx affected:libs", 17 | "affected:build": "./node_modules/.bin/nx affected:build", 18 | "affected:e2e": "./node_modules/.bin/nx affected:e2e", 19 | "affected:test": "./node_modules/.bin/nx affected:test", 20 | "affected:lint": "./node_modules/.bin/nx affected:lint", 21 | "affected:dep-graph": "./node_modules/.bin/nx affected:dep-graph", 22 | "format": "./node_modules/.bin/nx format:write", 23 | "format:write": "./node_modules/.bin/nx format:write", 24 | "format:check": "./node_modules/.bin/nx format:check", 25 | "update": "ng update @nrwl/workspace", 26 | "update:check": "ng update", 27 | "workspace-schematic": "./node_modules/.bin/nx workspace-schematic", 28 | "dep-graph": "./node_modules/.bin/nx dep-graph", 29 | "help": "./node_modules/.bin/nx help", 30 | "affected": "./node_modules/.bin/nx affected", 31 | "nx": "nx" 32 | }, 33 | "private": true, 34 | "dependencies": { 35 | "@angular/animations": "^8.2.12", 36 | "@angular/cdk": "^8.2.3", 37 | "@angular/common": "^8.2.12", 38 | "@angular/compiler": "^8.2.12", 39 | "@angular/core": "^8.2.12", 40 | "@angular/forms": "^8.2.12", 41 | "@angular/material": "^8.2.3", 42 | "@angular/platform-browser": "^8.2.12", 43 | "@angular/platform-browser-dynamic": "^8.2.12", 44 | "@angular/router": "^8.2.12", 45 | "@ngrx/effects": "8.4.0", 46 | "@ngrx/router-store": "8.4.0", 47 | "@ngrx/store": "8.4.0", 48 | "@nrwl/angular": "8.7.0", 49 | "@nrwl/nx": "^7.8.7", 50 | "core-js": "^2.5.4", 51 | "hammerjs": "^2.0.8", 52 | "rxjs": "^6.5.3", 53 | "tslib": "^1.9.0", 54 | "zone.js": "~0.10.2" 55 | }, 56 | "devDependencies": { 57 | "@angular-devkit/build-angular": "^0.803.21", 58 | "@angular/cli": "^8.3.15", 59 | "@angular/compiler-cli": "^8.2.12", 60 | "@angular/language-service": "^8.2.12", 61 | "@ngrx/schematics": "8.4.0", 62 | "@ngrx/store-devtools": "8.4.0", 63 | "@nrwl/workspace": "8.7.0", 64 | "@types/jasmine": "~2.8.6", 65 | "@types/jasminewd2": "~2.0.3", 66 | "@types/node": "~8.9.4", 67 | "codelyzer": "^5.0.1", 68 | "concurrently": "^4.0.1", 69 | "dotenv": "6.2.0", 70 | "jasmine-core": "~2.99.1", 71 | "jasmine-marbles": "0.4.0", 72 | "jasmine-spec-reporter": "~4.2.1", 73 | "json-server": "^0.14.0", 74 | "jsonwebtoken": "^8.3.0", 75 | "karma": "^4.3.0", 76 | "karma-chrome-launcher": "~2.2.0", 77 | "karma-coverage-istanbul-reporter": "~2.0.1", 78 | "karma-jasmine": "~1.1.0", 79 | "karma-jasmine-html-reporter": "^0.2.2", 80 | "prettier": "1.15.2", 81 | "protractor": "~5.4.0", 82 | "ts-node": "~7.0.0", 83 | "tslint": "~5.11.0", 84 | "typescript": "~3.5.3" 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /server/db.json: -------------------------------------------------------------------------------- 1 | { 2 | "customers": [ 3 | { 4 | "id": "1", 5 | "firstName": "Jonathan", 6 | "lastName": "Garvey", 7 | "email": "jon@gmail.coms", 8 | "phone": "1234567890", 9 | "title": "Technical Lead", 10 | "status": 1 11 | }, 12 | { 13 | "id": "2", 14 | "firstName": "Bob", 15 | "lastName": "Jones", 16 | "email": "bob@bobjones.com", 17 | "phone": "9372932391", 18 | "title": "CEO", 19 | "status": 2 20 | }, 21 | { 22 | "id": "3", 23 | "firstName": "Lukas", 24 | "lastName": "Ruebbelke", 25 | "email": "hey.player@gmail.com", 26 | "phone": "9876543212", 27 | "title": "CEO", 28 | "status": 1 29 | }, 30 | { 31 | "id": "4", 32 | "firstName": "Sally", 33 | "lastName": "McBride", 34 | "email": "silly.sally@hotmail.com", 35 | "phone": "3252352531", 36 | "title": "Receptionist", 37 | "status": 3 38 | }, 39 | { 40 | "id": "5", 41 | "firstName": "Donna", 42 | "lastName": "Barkley", 43 | "email": "donnab@aol.com", 44 | "phone": "0192837475", 45 | "title": "Student", 46 | "status": 4 47 | }, 48 | { 49 | "id": "6", 50 | "firstName": "Larry", 51 | "lastName": "Fitzgerald", 52 | "email": "super.secret@gmail.com", 53 | "phone": "1234432122", 54 | "title": "Quarterback", 55 | "status": 4 56 | }, 57 | { 58 | "id": "7", 59 | "firstName": "Victor", 60 | "lastName": "Wooten", 61 | "email": "w00t@victor.com", 62 | "phone": "1888333992", 63 | "title": "Bassist", 64 | "status": 1 65 | }, 66 | { 67 | "id": "8", 68 | "firstName": "Chris", 69 | "lastName": "Take", 70 | "email": "crispy@gmail.com", 71 | "phone": "9927381924", 72 | "title": "Developer", 73 | "status": 1 74 | }, 75 | { 76 | "id": "9", 77 | "firstName": "Christian", 78 | "lastName": "Peterson", 79 | "email": "cp3@lol.com", 80 | "phone": "0099831234", 81 | "title": "Handyman", 82 | "status": 3 83 | }, 84 | { 85 | "id": "10", 86 | "firstName": "RIP", 87 | "lastName": "Stick", 88 | "email": "r.i.p@deadly.com", 89 | "phone": "6123512311", 90 | "title": "Grim Reaper", 91 | "status": 2 92 | } 93 | ], 94 | "projects": [ 95 | { 96 | "id": "1", 97 | "title": "Project HOLLA!", 98 | "details": "This is a sample project", 99 | "percentComplete": 20, 100 | "approved": false, 101 | "startDate": null, 102 | "targetDate": null, 103 | "completionDate": null, 104 | "customerId": "1" 105 | }, 106 | { 107 | "id": "2", 108 | "title": "Project Two", 109 | "details": "This is a sample project", 110 | "percentComplete": 40, 111 | "approved": true, 112 | "startDate": null, 113 | "targetDate": null, 114 | "completionDate": null, 115 | "customerId": "3" 116 | }, 117 | { 118 | "id": "NaLriMg", 119 | "title": "TEST Project!", 120 | "details": "TEST", 121 | "percentComplete": 89, 122 | "approved": true 123 | } 124 | ] 125 | } -------------------------------------------------------------------------------- /server/server.js: -------------------------------------------------------------------------------- 1 | const fs = require('fs') 2 | const jsonServer = require('json-server') 3 | const jwt = require('jsonwebtoken') 4 | const middlewares = jsonServer.defaults() 5 | 6 | const server = jsonServer.create() 7 | const router = jsonServer.router('./server/db.json') 8 | const userdb = JSON.parse(fs.readFileSync('./server/users.json', 'UTF-8')) 9 | 10 | server.use(middlewares); 11 | 12 | const SECRET_KEY = '123456789' 13 | const expiresIn = '1h' 14 | 15 | // Create a token from a payload 16 | function createToken(payload) { 17 | return jwt.sign(payload, SECRET_KEY, { expiresIn }) 18 | } 19 | 20 | // Verify the token 21 | function verifyToken(token) { 22 | return jwt.verify(token, SECRET_KEY, (err, decode) => decode !== undefined ? decode : err) 23 | } 24 | 25 | // Check if the user exists in database 26 | function isAuthenticated({ email, password }) { 27 | return userdb.users.findIndex(user => user.email === email && user.password === password) !== -1 28 | } 29 | 30 | // To handle POST, PUT and PATCH you need to use a body-parser 31 | // You can use the one used by JSON Server 32 | server.use(jsonServer.bodyParser) 33 | server.post('/auth/login', (req, res) => { 34 | const {email, password} = req.body 35 | if (!isAuthenticated({email, password})) { 36 | const status = 401 37 | const message = 'Incorrect email or password' 38 | res.status(status).json({status, message}) 39 | return 40 | } 41 | const access_token = createToken({email, password}) 42 | res.status(200).json({access_token}) 43 | }) 44 | 45 | server.use(/^(?!\/auth).*$/, (req, res, next) => { 46 | if (req.headers.authorization === undefined || req.headers.authorization.split(' ')[0] !== 'Bearer') { 47 | const status = 401 48 | const message = 'Error in authorization format' 49 | res.status(status).json({ status, message }) 50 | return 51 | } 52 | try { 53 | verifyToken(req.headers.authorization.split(' ')[1]) 54 | next() 55 | } catch (err) { 56 | const status = 401 57 | const message = 'Error access_token is revoked' 58 | res.status(status).json({ status, message }) 59 | } 60 | }) 61 | 62 | server.use(router) 63 | 64 | server.listen(3000, () => { 65 | console.log('Run Auth API Server') 66 | }) 67 | -------------------------------------------------------------------------------- /server/users.json: -------------------------------------------------------------------------------- 1 | 2 | { 3 | "users": [ 4 | { 5 | "id": 1, 6 | "name": "admin", 7 | "email": "admin@email.com", 8 | "password": "admin" 9 | }, 10 | { 11 | "id": 2, 12 | "name": "techie", 13 | "email": "techie@email.com", 14 | "password": "techie" 15 | }, 16 | { 17 | "id": 3, 18 | "name": "user", 19 | "email": "user@email.com", 20 | "password": "user" 21 | } 22 | ] 23 | } 24 | -------------------------------------------------------------------------------- /tools/schematics/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onehungrymind/angular-core-workshop/f20badbfc54c3f3018b035e6187e482895cebb8f/tools/schematics/.gitkeep -------------------------------------------------------------------------------- /tools/tsconfig.tools.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../dist/out-tsc", 5 | "rootDir": ".", 6 | "module": "commonjs", 7 | "target": "es5", 8 | "types": ["jasmine", "node"] 9 | }, 10 | "include": ["**/*.ts"] 11 | } 12 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compileOnSave": false, 3 | "compilerOptions": { 4 | "importHelpers": true, 5 | "sourceMap": true, 6 | "declaration": false, 7 | "moduleResolution": "node", 8 | "emitDecoratorMetadata": true, 9 | "experimentalDecorators": true, 10 | "target": "es2015", 11 | "typeRoots": ["node_modules/@types"], 12 | "lib": ["es2017", "dom"], 13 | "baseUrl": ".", 14 | "paths": { 15 | "@workshop/material": ["libs/material/src/index.ts"], 16 | "@workshop/core-data": ["libs/core-data/src/index.ts"], 17 | "@workshop/ui-login": ["libs/ui-login/src/index.ts"], 18 | "@workshop/ui-toolbar": ["libs/ui-toolbar/src/index.ts"] 19 | }, 20 | "module": "esnext", 21 | "rootDir": "." 22 | }, 23 | "exclude": ["node_modules", "tmp"] 24 | } 25 | -------------------------------------------------------------------------------- /tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "rulesDirectory": [ 3 | "node_modules/codelyzer", 4 | "node_modules/@nrwl/workspace/src/tslint" 5 | ], 6 | "rules": { 7 | "arrow-return-shorthand": true, 8 | "callable-types": true, 9 | "class-name": true, 10 | "deprecation": { 11 | "severity": "warn" 12 | }, 13 | "forin": true, 14 | "import-blacklist": [true, "rxjs/Rx"], 15 | "interface-over-type-literal": true, 16 | "member-access": false, 17 | "member-ordering": [ 18 | true, 19 | { 20 | "order": [ 21 | "static-field", 22 | "instance-field", 23 | "static-method", 24 | "instance-method" 25 | ] 26 | } 27 | ], 28 | "no-arg": true, 29 | "no-bitwise": true, 30 | "no-console": [true, "debug", "info", "time", "timeEnd", "trace"], 31 | "no-construct": true, 32 | "no-debugger": true, 33 | "no-duplicate-super": true, 34 | "no-empty": false, 35 | "no-empty-interface": true, 36 | "no-eval": true, 37 | "no-inferrable-types": [true, "ignore-params"], 38 | "no-misused-new": true, 39 | "no-non-null-assertion": true, 40 | "no-shadowed-variable": true, 41 | "no-string-literal": false, 42 | "no-string-throw": true, 43 | "no-switch-case-fall-through": true, 44 | "no-unnecessary-initializer": true, 45 | "no-unused-expression": true, 46 | "no-use-before-declare": true, 47 | "no-var-keyword": true, 48 | "object-literal-sort-keys": false, 49 | "prefer-const": true, 50 | "radix": true, 51 | "triple-equals": [true, "allow-null-check"], 52 | "unified-signatures": true, 53 | "variable-name": false, 54 | "directive-selector": [true, "attribute", "app", "camelCase"], 55 | "component-selector": [true, "element", "app", "kebab-case"], 56 | "no-output-on-prefix": true, 57 | "no-inputs-metadata-property": true, 58 | "no-outputs-metadata-property": true, 59 | "no-host-metadata-property": true, 60 | "no-input-rename": true, 61 | "no-output-rename": true, 62 | "use-lifecycle-interface": true, 63 | "use-pipe-transform-interface": true, 64 | "component-class-suffix": true, 65 | "directive-class-suffix": true, 66 | "nx-enforce-module-boundaries": [ 67 | true, 68 | { 69 | "allow": [], 70 | "depConstraints": [ 71 | { 72 | "sourceTag": "*", 73 | "onlyDependOnLibsWithTags": ["*"] 74 | } 75 | ] 76 | } 77 | ] 78 | } 79 | } 80 | --------------------------------------------------------------------------------