├── .editorconfig ├── .gitignore ├── .prettierignore ├── .prettierrc ├── .vscode └── extensions.json ├── README.md ├── angular.json ├── apps ├── .gitkeep ├── forms-course-e2e │ ├── cypress.json │ ├── src │ │ ├── fixtures │ │ │ └── example.json │ │ ├── integration │ │ │ └── app.spec.ts │ │ ├── plugins │ │ │ └── index.ts │ │ └── support │ │ │ ├── app.po.ts │ │ │ ├── commands.ts │ │ │ └── index.ts │ ├── tsconfig.e2e.json │ └── tsconfig.json └── forms-course │ ├── browserslist │ ├── jest.config.js │ ├── src │ ├── app │ │ ├── app.component.html │ │ ├── app.component.scss │ │ ├── app.component.spec.ts │ │ ├── app.component.ts │ │ └── app.module.ts │ ├── assets │ │ └── .gitkeep │ ├── environments │ │ ├── environment.prod.ts │ │ └── environment.ts │ ├── favicon.ico │ ├── index.html │ ├── main.ts │ ├── polyfills.ts │ ├── styles.scss │ └── test-setup.ts │ ├── tsconfig.app.json │ ├── tsconfig.json │ ├── tsconfig.spec.json │ └── tslint.json ├── jest.config.js ├── libs ├── .gitkeep ├── section1 │ ├── README.md │ ├── jest.config.js │ ├── src │ │ ├── index.ts │ │ ├── lib │ │ │ ├── lesson1 │ │ │ │ ├── completed │ │ │ │ │ ├── lesson1-completed-making-forms-dynamic │ │ │ │ │ │ ├── lesson1-completed-making-forms-dynamic.component.css │ │ │ │ │ │ ├── lesson1-completed-making-forms-dynamic.component.html │ │ │ │ │ │ ├── lesson1-completed-making-forms-dynamic.component.spec.ts │ │ │ │ │ │ └── lesson1-completed-making-forms-dynamic.component.ts │ │ │ │ │ ├── lesson1-completed-number-input │ │ │ │ │ │ ├── lesson1-completed-number-input.component.css │ │ │ │ │ │ ├── lesson1-completed-number-input.component.html │ │ │ │ │ │ ├── lesson1-completed-number-input.component.spec.ts │ │ │ │ │ │ └── lesson1-completed-number-input.component.ts │ │ │ │ │ ├── lesson1-completed-other-controls │ │ │ │ │ │ ├── lesson1-completed-other-controls.component.css │ │ │ │ │ │ ├── lesson1-completed-other-controls.component.html │ │ │ │ │ │ ├── lesson1-completed-other-controls.component.spec.ts │ │ │ │ │ │ └── lesson1-completed-other-controls.component.ts │ │ │ │ │ ├── lesson1-completed-shell │ │ │ │ │ │ ├── lesson1-completed-shell.component.css │ │ │ │ │ │ ├── lesson1-completed-shell.component.html │ │ │ │ │ │ ├── lesson1-completed-shell.component.spec.ts │ │ │ │ │ │ └── lesson1-completed-shell.component.ts │ │ │ │ │ └── lesson1-completed-text-input │ │ │ │ │ │ ├── lesson1-completed-text-input.component.css │ │ │ │ │ │ ├── lesson1-completed-text-input.component.html │ │ │ │ │ │ ├── lesson1-completed-text-input.component.spec.ts │ │ │ │ │ │ └── lesson1-completed-text-input.component.ts │ │ │ │ ├── making-forms-dynamic │ │ │ │ │ ├── making-forms-dynamic.component.css │ │ │ │ │ ├── making-forms-dynamic.component.html │ │ │ │ │ ├── making-forms-dynamic.component.spec.ts │ │ │ │ │ └── making-forms-dynamic.component.ts │ │ │ │ ├── number-input │ │ │ │ │ ├── number-input.component.css │ │ │ │ │ ├── number-input.component.html │ │ │ │ │ ├── number-input.component.spec.ts │ │ │ │ │ └── number-input.component.ts │ │ │ │ ├── other-controls │ │ │ │ │ ├── other-controls.component.css │ │ │ │ │ ├── other-controls.component.html │ │ │ │ │ ├── other-controls.component.spec.ts │ │ │ │ │ └── other-controls.component.ts │ │ │ │ └── text-input │ │ │ │ │ ├── text-input.component.css │ │ │ │ │ ├── text-input.component.html │ │ │ │ │ ├── text-input.component.spec.ts │ │ │ │ │ └── text-input.component.ts │ │ │ ├── lesson2 │ │ │ │ ├── completed │ │ │ │ │ ├── lesson2-completed-filtering-a-list │ │ │ │ │ │ ├── lesson2-completed-filtering-a-list.component.css │ │ │ │ │ │ ├── lesson2-completed-filtering-a-list.component.html │ │ │ │ │ │ ├── lesson2-completed-filtering-a-list.component.spec.ts │ │ │ │ │ │ └── lesson2-completed-filtering-a-list.component.ts │ │ │ │ │ └── lesson2-completed-hero-form │ │ │ │ │ │ ├── lesson2-completed-hero-form.component.css │ │ │ │ │ │ ├── lesson2-completed-hero-form.component.html │ │ │ │ │ │ ├── lesson2-completed-hero-form.component.spec.ts │ │ │ │ │ │ └── lesson2-completed-hero-form.component.ts │ │ │ │ ├── filtering-a-list │ │ │ │ │ ├── filtering-a-list.component.css │ │ │ │ │ ├── filtering-a-list.component.html │ │ │ │ │ ├── filtering-a-list.component.spec.ts │ │ │ │ │ └── filtering-a-list.component.ts │ │ │ │ ├── hero-form │ │ │ │ │ ├── hero-form.component.css │ │ │ │ │ ├── hero-form.component.html │ │ │ │ │ ├── hero-form.component.spec.ts │ │ │ │ │ └── hero-form.component.ts │ │ │ │ └── lesson2-shell │ │ │ │ │ ├── lesson2-shell.component.css │ │ │ │ │ ├── lesson2-shell.component.html │ │ │ │ │ ├── lesson2-shell.component.spec.ts │ │ │ │ │ └── lesson2-shell.component.ts │ │ │ ├── lesson3 │ │ │ │ ├── completed │ │ │ │ │ ├── lesson3-completed-party-form │ │ │ │ │ │ ├── lesson3-completed-party-form.component.css │ │ │ │ │ │ ├── lesson3-completed-party-form.component.html │ │ │ │ │ │ ├── lesson3-completed-party-form.component.spec.ts │ │ │ │ │ │ └── lesson3-completed-party-form.component.ts │ │ │ │ │ └── lesson3-completed-simple-dynamic-array │ │ │ │ │ │ ├── lesson3-completed-simple-dynamic-array.component.css │ │ │ │ │ │ ├── lesson3-completed-simple-dynamic-array.component.html │ │ │ │ │ │ ├── lesson3-completed-simple-dynamic-array.component.spec.ts │ │ │ │ │ │ └── lesson3-completed-simple-dynamic-array.component.ts │ │ │ │ ├── lesson3-shell │ │ │ │ │ ├── lesson3-shell.component.css │ │ │ │ │ ├── lesson3-shell.component.html │ │ │ │ │ ├── lesson3-shell.component.spec.ts │ │ │ │ │ └── lesson3-shell.component.ts │ │ │ │ ├── party-form │ │ │ │ │ ├── party-form.component.css │ │ │ │ │ ├── party-form.component.html │ │ │ │ │ ├── party-form.component.spec.ts │ │ │ │ │ └── party-form.component.ts │ │ │ │ └── simple-dynamic-array │ │ │ │ │ ├── simple-dynamic-array.component.css │ │ │ │ │ ├── simple-dynamic-array.component.html │ │ │ │ │ ├── simple-dynamic-array.component.spec.ts │ │ │ │ │ └── simple-dynamic-array.component.ts │ │ │ ├── section1.module.spec.ts │ │ │ └── section1.module.ts │ │ └── test-setup.ts │ ├── tsconfig.json │ ├── tsconfig.lib.json │ ├── tsconfig.spec.json │ └── tslint.json ├── section2 │ ├── README.md │ ├── jest.config.js │ ├── src │ │ ├── index.ts │ │ ├── lib │ │ │ ├── +state │ │ │ │ ├── hero.actions.ts │ │ │ │ ├── hero.reducer.ts │ │ │ │ └── hero.selector.ts │ │ │ ├── api.service.spec.ts │ │ │ ├── api.service.ts │ │ │ ├── lesson1 │ │ │ │ ├── completed │ │ │ │ │ ├── lesson1-completed-hero-validation │ │ │ │ │ │ ├── lesson1-completed-hero-validation.component.css │ │ │ │ │ │ ├── lesson1-completed-hero-validation.component.html │ │ │ │ │ │ ├── lesson1-completed-hero-validation.component.spec.ts │ │ │ │ │ │ └── lesson1-completed-hero-validation.component.ts │ │ │ │ │ └── lesson1-completed-simple-built-in-validators │ │ │ │ │ │ ├── lesson1-completed-simple-built-in-validators.component.css │ │ │ │ │ │ ├── lesson1-completed-simple-built-in-validators.component.html │ │ │ │ │ │ ├── lesson1-completed-simple-built-in-validators.component.spec.ts │ │ │ │ │ │ └── lesson1-completed-simple-built-in-validators.component.ts │ │ │ │ ├── hero-validation │ │ │ │ │ ├── hero-validation.component.css │ │ │ │ │ ├── hero-validation.component.html │ │ │ │ │ ├── hero-validation.component.spec.ts │ │ │ │ │ └── hero-validation.component.ts │ │ │ │ ├── lesson1-shell │ │ │ │ │ ├── lesson1-shell.component.css │ │ │ │ │ ├── lesson1-shell.component.html │ │ │ │ │ ├── lesson1-shell.component.spec.ts │ │ │ │ │ └── lesson1-shell.component.ts │ │ │ │ └── simple-built-in-validators │ │ │ │ │ ├── simple-built-in-validators.component.css │ │ │ │ │ ├── simple-built-in-validators.component.html │ │ │ │ │ ├── simple-built-in-validators.component.spec.ts │ │ │ │ │ └── simple-built-in-validators.component.ts │ │ │ ├── lesson2 │ │ │ │ ├── bootstap-example │ │ │ │ │ ├── bootstap-example.component.css │ │ │ │ │ ├── bootstap-example.component.html │ │ │ │ │ ├── bootstap-example.component.spec.ts │ │ │ │ │ └── bootstap-example.component.ts │ │ │ │ ├── completed │ │ │ │ │ ├── lesson2-completed-bootstrap-example │ │ │ │ │ │ ├── lesson2-completed-bootstrap-example.component.css │ │ │ │ │ │ ├── lesson2-completed-bootstrap-example.component.html │ │ │ │ │ │ ├── lesson2-completed-bootstrap-example.component.spec.ts │ │ │ │ │ │ └── lesson2-completed-bootstrap-example.component.ts │ │ │ │ │ └── lesson2-completed-material-example │ │ │ │ │ │ ├── lesson2-completed-material-example.component.css │ │ │ │ │ │ ├── lesson2-completed-material-example.component.html │ │ │ │ │ │ ├── lesson2-completed-material-example.component.spec.ts │ │ │ │ │ │ └── lesson2-completed-material-example.component.ts │ │ │ │ ├── lesson2-shell │ │ │ │ │ ├── lesson2-shell.component.css │ │ │ │ │ ├── lesson2-shell.component.html │ │ │ │ │ ├── lesson2-shell.component.spec.ts │ │ │ │ │ └── lesson2-shell.component.ts │ │ │ │ └── material-example │ │ │ │ │ ├── material-example.component.css │ │ │ │ │ ├── material-example.component.html │ │ │ │ │ ├── material-example.component.spec.ts │ │ │ │ │ └── material-example.component.ts │ │ │ ├── lesson3 │ │ │ │ ├── completed │ │ │ │ │ └── lesson3-completed-hero-validation │ │ │ │ │ │ ├── lesson3-completed-hero-validation.component.css │ │ │ │ │ │ ├── lesson3-completed-hero-validation.component.html │ │ │ │ │ │ ├── lesson3-completed-hero-validation.component.spec.ts │ │ │ │ │ │ └── lesson3-completed-hero-validation.component.ts │ │ │ │ ├── hero-validation │ │ │ │ │ ├── hero-validation.component.css │ │ │ │ │ ├── hero-validation.component.html │ │ │ │ │ ├── hero-validation.component.spec.ts │ │ │ │ │ └── hero-validation.component.ts │ │ │ │ └── lesson3-shell │ │ │ │ │ ├── lesson3-shell.component.css │ │ │ │ │ ├── lesson3-shell.component.html │ │ │ │ │ ├── lesson3-shell.component.spec.ts │ │ │ │ │ └── lesson3-shell.component.ts │ │ │ ├── lesson4 │ │ │ │ ├── completed │ │ │ │ │ ├── lesson4-completed-full-name │ │ │ │ │ │ ├── lesson4-completed-full-name.component.css │ │ │ │ │ │ ├── lesson4-completed-full-name.component.html │ │ │ │ │ │ ├── lesson4-completed-full-name.component.spec.ts │ │ │ │ │ │ └── lesson4-completed-full-name.component.ts │ │ │ │ │ └── lesson4-completed-hero-adder │ │ │ │ │ │ ├── lesson4-completed-hero-adder.component.css │ │ │ │ │ │ ├── lesson4-completed-hero-adder.component.html │ │ │ │ │ │ ├── lesson4-completed-hero-adder.component.spec.ts │ │ │ │ │ │ └── lesson4-completed-hero-adder.component.ts │ │ │ │ ├── full-name │ │ │ │ │ ├── full-name.component.css │ │ │ │ │ ├── full-name.component.html │ │ │ │ │ ├── full-name.component.spec.ts │ │ │ │ │ └── full-name.component.ts │ │ │ │ ├── hero-adder │ │ │ │ │ ├── hero-adder.component.css │ │ │ │ │ ├── hero-adder.component.html │ │ │ │ │ ├── hero-adder.component.spec.ts │ │ │ │ │ └── hero-adder.component.ts │ │ │ │ └── lesson4-shell │ │ │ │ │ ├── lesson4-shell.component.css │ │ │ │ │ ├── lesson4-shell.component.html │ │ │ │ │ ├── lesson4-shell.component.spec.ts │ │ │ │ │ └── lesson4-shell.component.ts │ │ │ ├── lesson5 │ │ │ │ └── lesson5-shell │ │ │ │ │ ├── lesson5-shell.component.css │ │ │ │ │ ├── lesson5-shell.component.html │ │ │ │ │ ├── lesson5-shell.component.spec.ts │ │ │ │ │ └── lesson5-shell.component.ts │ │ │ ├── section2.module.spec.ts │ │ │ └── section2.module.ts │ │ └── test-setup.ts │ ├── tsconfig.json │ ├── tsconfig.lib.json │ ├── tsconfig.spec.json │ └── tslint.json ├── section3 │ ├── README.md │ ├── jest.config.js │ ├── src │ │ ├── index.ts │ │ ├── lib │ │ │ ├── lesson1 │ │ │ │ ├── completed │ │ │ │ │ ├── lesson1-completed-number-picker │ │ │ │ │ │ ├── lesson1-completed-number-picker.component.css │ │ │ │ │ │ ├── lesson1-completed-number-picker.component.html │ │ │ │ │ │ ├── lesson1-completed-number-picker.component.spec.ts │ │ │ │ │ │ └── lesson1-completed-number-picker.component.ts │ │ │ │ │ └── lesson1-completed-toggle-form │ │ │ │ │ │ ├── lesson1-completed-toggle-form.component.html │ │ │ │ │ │ ├── lesson1-completed-toggle-form.component.scss │ │ │ │ │ │ ├── lesson1-completed-toggle-form.component.spec.ts │ │ │ │ │ │ └── lesson1-completed-toggle-form.component.ts │ │ │ │ ├── lesson1-shell │ │ │ │ │ ├── lesson1-shell.component.css │ │ │ │ │ ├── lesson1-shell.component.html │ │ │ │ │ ├── lesson1-shell.component.spec.ts │ │ │ │ │ └── lesson1-shell.component.ts │ │ │ │ ├── number-picker │ │ │ │ │ ├── number-picker.component.css │ │ │ │ │ ├── number-picker.component.html │ │ │ │ │ ├── number-picker.component.spec.ts │ │ │ │ │ └── number-picker.component.ts │ │ │ │ └── toggle-form │ │ │ │ │ ├── toggle-form.component.css │ │ │ │ │ ├── toggle-form.component.html │ │ │ │ │ ├── toggle-form.component.spec.ts │ │ │ │ │ └── toggle-form.component.ts │ │ │ ├── lesson2 │ │ │ │ ├── completed │ │ │ │ │ └── lesson2-completed-date-time-picker │ │ │ │ │ │ ├── lesson2-completed-date-time-picker.component.css │ │ │ │ │ │ ├── lesson2-completed-date-time-picker.component.html │ │ │ │ │ │ ├── lesson2-completed-date-time-picker.component.spec.ts │ │ │ │ │ │ └── lesson2-completed-date-time-picker.component.ts │ │ │ │ ├── date-time-picker │ │ │ │ │ ├── date-time-picker.component.css │ │ │ │ │ ├── date-time-picker.component.html │ │ │ │ │ ├── date-time-picker.component.spec.ts │ │ │ │ │ └── date-time-picker.component.ts │ │ │ │ └── lesson2-shell │ │ │ │ │ ├── lesson2-shell.component.css │ │ │ │ │ ├── lesson2-shell.component.html │ │ │ │ │ ├── lesson2-shell.component.spec.ts │ │ │ │ │ └── lesson2-shell.component.ts │ │ │ ├── lesson3 │ │ │ │ ├── completed │ │ │ │ │ └── lesson3-completed-hero-form │ │ │ │ │ │ ├── lesson3-completed-hero-form.component.css │ │ │ │ │ │ ├── lesson3-completed-hero-form.component.html │ │ │ │ │ │ ├── lesson3-completed-hero-form.component.spec.ts │ │ │ │ │ │ └── lesson3-completed-hero-form.component.ts │ │ │ │ ├── hero-form │ │ │ │ │ ├── hero-form.component.css │ │ │ │ │ ├── hero-form.component.html │ │ │ │ │ ├── hero-form.component.spec.ts │ │ │ │ │ └── hero-form.component.ts │ │ │ │ └── lesson3-shell │ │ │ │ │ ├── lesson3-shell.component.css │ │ │ │ │ ├── lesson3-shell.component.html │ │ │ │ │ ├── lesson3-shell.component.spec.ts │ │ │ │ │ └── lesson3-shell.component.ts │ │ │ ├── section3.module.spec.ts │ │ │ └── section3.module.ts │ │ └── test-setup.ts │ ├── tsconfig.json │ ├── tsconfig.lib.json │ ├── tsconfig.spec.json │ └── tslint.json ├── section4 │ ├── README.md │ ├── jest.config.js │ ├── src │ │ ├── index.ts │ │ ├── lib │ │ │ ├── date-range-picker-utils.ts │ │ │ ├── date-time-picker │ │ │ │ ├── date-time-picker.component.css │ │ │ │ ├── date-time-picker.component.html │ │ │ │ ├── date-time-picker.component.spec.ts │ │ │ │ └── date-time-picker.component.ts │ │ │ ├── family-tree.utils.ts │ │ │ ├── hero-form │ │ │ │ ├── hero-form.component.css │ │ │ │ ├── hero-form.component.html │ │ │ │ ├── hero-form.component.spec.ts │ │ │ │ ├── hero-form.component.ts │ │ │ │ └── hero-form.utils.ts │ │ │ ├── hero-party-utils.ts │ │ │ ├── lesson1 │ │ │ │ ├── completed │ │ │ │ │ └── lesson1-completed-date-time-range-picker │ │ │ │ │ │ ├── lesson1-completed-date-time-range-picker.component.css │ │ │ │ │ │ ├── lesson1-completed-date-time-range-picker.component.html │ │ │ │ │ │ ├── lesson1-completed-date-time-range-picker.component.spec.ts │ │ │ │ │ │ └── lesson1-completed-date-time-range-picker.component.ts │ │ │ │ ├── date-range-picker-form │ │ │ │ │ ├── date-range-picker-form.component.css │ │ │ │ │ ├── date-range-picker-form.component.html │ │ │ │ │ ├── date-range-picker-form.component.spec.ts │ │ │ │ │ └── date-range-picker-form.component.ts │ │ │ │ └── lesson1-shell │ │ │ │ │ ├── lesson1-shell.component.css │ │ │ │ │ ├── lesson1-shell.component.html │ │ │ │ │ ├── lesson1-shell.component.spec.ts │ │ │ │ │ └── lesson1-shell.component.ts │ │ │ ├── lesson2 │ │ │ │ ├── completed │ │ │ │ │ └── lesson2-completed-hero-party-form │ │ │ │ │ │ ├── lesson2-completed-hero-party-form.component.css │ │ │ │ │ │ ├── lesson2-completed-hero-party-form.component.html │ │ │ │ │ │ ├── lesson2-completed-hero-party-form.component.spec.ts │ │ │ │ │ │ └── lesson2-completed-hero-party-form.component.ts │ │ │ │ ├── hero-party-form │ │ │ │ │ ├── hero-party-form.component.css │ │ │ │ │ ├── hero-party-form.component.html │ │ │ │ │ ├── hero-party-form.component.spec.ts │ │ │ │ │ └── hero-party-form.component.ts │ │ │ │ └── lesson2-shell │ │ │ │ │ ├── lesson2-shell.component.css │ │ │ │ │ ├── lesson2-shell.component.html │ │ │ │ │ ├── lesson2-shell.component.spec.ts │ │ │ │ │ └── lesson2-shell.component.ts │ │ │ ├── lesson3 │ │ │ │ ├── completed │ │ │ │ │ └── lesson3-completed-family-tree-form │ │ │ │ │ │ ├── lesson3-completed-family-tree-form.component.css │ │ │ │ │ │ ├── lesson3-completed-family-tree-form.component.html │ │ │ │ │ │ ├── lesson3-completed-family-tree-form.component.spec.ts │ │ │ │ │ │ └── lesson3-completed-family-tree-form.component.ts │ │ │ │ ├── family-tree-form │ │ │ │ │ ├── family-tree-form.component.css │ │ │ │ │ ├── family-tree-form.component.html │ │ │ │ │ ├── family-tree-form.component.spec.ts │ │ │ │ │ └── family-tree-form.component.ts │ │ │ │ └── lesson3-shell │ │ │ │ │ ├── lesson3-shell.component.css │ │ │ │ │ ├── lesson3-shell.component.html │ │ │ │ │ ├── lesson3-shell.component.spec.ts │ │ │ │ │ └── lesson3-shell.component.ts │ │ │ ├── lesson4 │ │ │ │ └── lesson4-shell │ │ │ │ │ ├── lesson4-shell.component.css │ │ │ │ │ ├── lesson4-shell.component.html │ │ │ │ │ ├── lesson4-shell.component.spec.ts │ │ │ │ │ └── lesson4-shell.component.ts │ │ │ ├── section4.module.spec.ts │ │ │ └── section4.module.ts │ │ └── test-setup.ts │ ├── tsconfig.json │ ├── tsconfig.lib.json │ ├── tsconfig.spec.json │ └── tslint.json ├── section5 │ ├── README.md │ ├── jest.config.js │ ├── src │ │ ├── index.ts │ │ ├── lib │ │ │ ├── +state │ │ │ │ ├── config-settings │ │ │ │ │ ├── config-settings.actions.ts │ │ │ │ │ ├── config-settings.effects.ts │ │ │ │ │ ├── config-settings.interfaces.ts │ │ │ │ │ ├── config-settings.reducer.ts │ │ │ │ │ ├── config-settings.selectors.ts │ │ │ │ │ └── index.ts │ │ │ │ └── index.ts │ │ │ ├── completed │ │ │ │ ├── completed-boolean-config-setting-form │ │ │ │ │ ├── completed-boolean-config-setting-form.component.css │ │ │ │ │ ├── completed-boolean-config-setting-form.component.html │ │ │ │ │ ├── completed-boolean-config-setting-form.component.spec.ts │ │ │ │ │ └── completed-boolean-config-setting-form.component.ts │ │ │ │ ├── completed-confimation-dialog │ │ │ │ │ ├── completed-confimation-dialog.component.css │ │ │ │ │ ├── completed-confimation-dialog.component.html │ │ │ │ │ ├── completed-confimation-dialog.component.spec.ts │ │ │ │ │ └── completed-confimation-dialog.component.ts │ │ │ │ ├── completed-confirm-discard-changes.guard.spec.ts │ │ │ │ ├── completed-confirm-discard-changes.guard.ts │ │ │ │ ├── completed-discard-changes-dialog │ │ │ │ │ ├── completed-discard-changes-dialog.component.css │ │ │ │ │ ├── completed-discard-changes-dialog.component.html │ │ │ │ │ ├── completed-discard-changes-dialog.component.spec.ts │ │ │ │ │ └── completed-discard-changes-dialog.component.ts │ │ │ │ ├── completed-number-config-setting-form │ │ │ │ │ ├── completed-number-config-setting-form.component.css │ │ │ │ │ ├── completed-number-config-setting-form.component.html │ │ │ │ │ ├── completed-number-config-setting-form.component.spec.ts │ │ │ │ │ └── completed-number-config-setting-form.component.ts │ │ │ │ ├── completed-string-config-setting-form │ │ │ │ │ ├── completed-string-config-setting-form.component.css │ │ │ │ │ ├── completed-string-config-setting-form.component.html │ │ │ │ │ ├── completed-string-config-setting-form.component.spec.ts │ │ │ │ │ └── completed-string-config-setting-form.component.ts │ │ │ │ ├── completed-wizard-form │ │ │ │ │ ├── completed-wizard-form.component.html │ │ │ │ │ ├── completed-wizard-form.component.scss │ │ │ │ │ ├── completed-wizard-form.component.spec.ts │ │ │ │ │ └── completed-wizard-form.component.ts │ │ │ │ └── completed-wizard │ │ │ │ │ ├── completed-wizard.component.html │ │ │ │ │ ├── completed-wizard.component.scss │ │ │ │ │ ├── completed-wizard.component.spec.ts │ │ │ │ │ └── completed-wizard.component.ts │ │ │ ├── config-settings.utils.ts │ │ │ ├── lesson1 │ │ │ │ ├── boolean-config-setting-form │ │ │ │ │ ├── boolean-config-setting-form.component.css │ │ │ │ │ ├── boolean-config-setting-form.component.html │ │ │ │ │ ├── boolean-config-setting-form.component.spec.ts │ │ │ │ │ └── boolean-config-setting-form.component.ts │ │ │ │ ├── lesson1-shell │ │ │ │ │ ├── lesson1-shell.component.css │ │ │ │ │ ├── lesson1-shell.component.html │ │ │ │ │ ├── lesson1-shell.component.spec.ts │ │ │ │ │ └── lesson1-shell.component.ts │ │ │ │ ├── number-config-setting-form │ │ │ │ │ ├── number-config-setting-form.component.css │ │ │ │ │ ├── number-config-setting-form.component.html │ │ │ │ │ ├── number-config-setting-form.component.spec.ts │ │ │ │ │ └── number-config-setting-form.component.ts │ │ │ │ └── string-config-setting-form │ │ │ │ │ ├── string-config-setting-form.component.css │ │ │ │ │ ├── string-config-setting-form.component.html │ │ │ │ │ ├── string-config-setting-form.component.spec.ts │ │ │ │ │ └── string-config-setting-form.component.ts │ │ │ ├── lesson2 │ │ │ │ ├── lesson2-shell │ │ │ │ │ ├── lesson2-shell.component.css │ │ │ │ │ ├── lesson2-shell.component.html │ │ │ │ │ ├── lesson2-shell.component.spec.ts │ │ │ │ │ └── lesson2-shell.component.ts │ │ │ │ └── wizard-form │ │ │ │ │ ├── wizard-form.component.html │ │ │ │ │ ├── wizard-form.component.scss │ │ │ │ │ ├── wizard-form.component.spec.ts │ │ │ │ │ └── wizard-form.component.ts │ │ │ ├── lesson3 │ │ │ │ └── lesson3-shell │ │ │ │ │ ├── lesson3-shell.component.css │ │ │ │ │ ├── lesson3-shell.component.html │ │ │ │ │ ├── lesson3-shell.component.spec.ts │ │ │ │ │ └── lesson3-shell.component.ts │ │ │ ├── lesson4 │ │ │ │ ├── confirm-discard-changes.guard.ts.guard.spec.ts │ │ │ │ ├── confirm-discard-changes.guard.ts.guard.ts │ │ │ │ └── lesson4-shell │ │ │ │ │ ├── lesson4-shell.component.css │ │ │ │ │ ├── lesson4-shell.component.html │ │ │ │ │ ├── lesson4-shell.component.spec.ts │ │ │ │ │ └── lesson4-shell.component.ts │ │ │ ├── lesson5 │ │ │ │ └── lesson5-shell │ │ │ │ │ ├── lesson5-shell.component.css │ │ │ │ │ ├── lesson5-shell.component.html │ │ │ │ │ ├── lesson5-shell.component.spec.ts │ │ │ │ │ └── lesson5-shell.component.ts │ │ │ ├── section5.module.spec.ts │ │ │ ├── section5.module.ts │ │ │ ├── wizard-form.utils.ts │ │ │ └── wizard │ │ │ │ ├── wizard.component.css │ │ │ │ ├── wizard.component.html │ │ │ │ ├── wizard.component.spec.ts │ │ │ │ └── wizard.component.ts │ │ └── test-setup.ts │ ├── tsconfig.json │ ├── tsconfig.lib.json │ ├── tsconfig.spec.json │ └── tslint.json ├── section6 │ ├── README.md │ ├── jest.config.js │ ├── src │ │ ├── index.ts │ │ ├── lib │ │ │ ├── +state │ │ │ │ ├── hero.reducer.ts │ │ │ │ ├── hero.selector.ts │ │ │ │ ├── hero.service.spec.ts │ │ │ │ ├── hero.service.ts │ │ │ │ └── hero.utils.ts │ │ │ ├── lesson1 │ │ │ │ ├── completed │ │ │ │ │ ├── lesson1-completed-hero-grid │ │ │ │ │ │ ├── lesson1-completed-hero-grid.component.css │ │ │ │ │ │ ├── lesson1-completed-hero-grid.component.html │ │ │ │ │ │ ├── lesson1-completed-hero-grid.component.spec.ts │ │ │ │ │ │ └── lesson1-completed-hero-grid.component.ts │ │ │ │ │ └── lesson1-completed-pagination-form │ │ │ │ │ │ ├── lesson1-completed-pagination-form.component.css │ │ │ │ │ │ ├── lesson1-completed-pagination-form.component.html │ │ │ │ │ │ ├── lesson1-completed-pagination-form.component.spec.ts │ │ │ │ │ │ └── lesson1-completed-pagination-form.component.ts │ │ │ │ ├── hero-grid │ │ │ │ │ ├── hero-grid.component.css │ │ │ │ │ ├── hero-grid.component.html │ │ │ │ │ ├── hero-grid.component.spec.ts │ │ │ │ │ └── hero-grid.component.ts │ │ │ │ ├── lesson1-shell │ │ │ │ │ ├── lesson1-shell.component.css │ │ │ │ │ ├── lesson1-shell.component.html │ │ │ │ │ ├── lesson1-shell.component.spec.ts │ │ │ │ │ └── lesson1-shell.component.ts │ │ │ │ └── pagination-form │ │ │ │ │ ├── pagination-form.component.css │ │ │ │ │ ├── pagination-form.component.html │ │ │ │ │ ├── pagination-form.component.spec.ts │ │ │ │ │ └── pagination-form.component.ts │ │ │ ├── lesson2 │ │ │ │ ├── completed │ │ │ │ │ └── lesson2-completed-table-form │ │ │ │ │ │ ├── lesson2-completed-table-form.component.css │ │ │ │ │ │ ├── lesson2-completed-table-form.component.html │ │ │ │ │ │ ├── lesson2-completed-table-form.component.spec.ts │ │ │ │ │ │ └── lesson2-completed-table-form.component.ts │ │ │ │ ├── lesson2-shell │ │ │ │ │ ├── lesson2-shell.component.css │ │ │ │ │ ├── lesson2-shell.component.html │ │ │ │ │ ├── lesson2-shell.component.spec.ts │ │ │ │ │ └── lesson2-shell.component.ts │ │ │ │ └── table-form │ │ │ │ │ ├── table-form.component.css │ │ │ │ │ ├── table-form.component.html │ │ │ │ │ ├── table-form.component.spec.ts │ │ │ │ │ └── table-form.component.ts │ │ │ ├── lesson3 │ │ │ │ ├── client-side-table │ │ │ │ │ ├── client-side-table.component.css │ │ │ │ │ ├── client-side-table.component.html │ │ │ │ │ ├── client-side-table.component.spec.ts │ │ │ │ │ └── client-side-table.component.ts │ │ │ │ ├── completed │ │ │ │ │ └── lesson3-completed-client-side-table │ │ │ │ │ │ ├── lesson3-completed-client-side-table.component.css │ │ │ │ │ │ ├── lesson3-completed-client-side-table.component.html │ │ │ │ │ │ ├── lesson3-completed-client-side-table.component.spec.ts │ │ │ │ │ │ └── lesson3-completed-client-side-table.component.ts │ │ │ │ └── lesson3-shell │ │ │ │ │ ├── lesson3-shell.component.css │ │ │ │ │ ├── lesson3-shell.component.html │ │ │ │ │ ├── lesson3-shell.component.spec.ts │ │ │ │ │ └── lesson3-shell.component.ts │ │ │ ├── lesson4 │ │ │ │ ├── completed │ │ │ │ │ └── lesson4-completed-server-side-table │ │ │ │ │ │ ├── lesson4-completed-server-side-table.component.css │ │ │ │ │ │ ├── lesson4-completed-server-side-table.component.html │ │ │ │ │ │ ├── lesson4-completed-server-side-table.component.spec.ts │ │ │ │ │ │ └── lesson4-completed-server-side-table.component.ts │ │ │ │ ├── lesson4-shell │ │ │ │ │ ├── lesson4-shell.component.css │ │ │ │ │ ├── lesson4-shell.component.html │ │ │ │ │ ├── lesson4-shell.component.spec.ts │ │ │ │ │ └── lesson4-shell.component.ts │ │ │ │ └── server-side-table │ │ │ │ │ ├── server-side-table.component.css │ │ │ │ │ ├── server-side-table.component.html │ │ │ │ │ ├── server-side-table.component.spec.ts │ │ │ │ │ └── server-side-table.component.ts │ │ │ ├── section6.module.spec.ts │ │ │ └── section6.module.ts │ │ └── test-setup.ts │ ├── tsconfig.json │ ├── tsconfig.lib.json │ ├── tsconfig.spec.json │ └── tslint.json └── ui-common │ ├── README.md │ ├── jest.config.js │ ├── src │ ├── index.ts │ ├── lib │ │ ├── animations.ts │ │ ├── code-preview │ │ │ ├── code-preview.component.css │ │ │ ├── code-preview.component.html │ │ │ ├── code-preview.component.spec.ts │ │ │ └── code-preview.component.ts │ │ ├── file-to-preview.interface.ts │ │ ├── instructions │ │ │ ├── instructions.component.css │ │ │ ├── instructions.component.html │ │ │ ├── instructions.component.spec.ts │ │ │ └── instructions.component.ts │ │ ├── lesson-frame.interface.ts │ │ ├── lesson-frame │ │ │ ├── lesson-frame.component.css │ │ │ ├── lesson-frame.component.html │ │ │ ├── lesson-frame.component.spec.ts │ │ │ └── lesson-frame.component.ts │ │ ├── section-shell │ │ │ ├── section-shell.component.html │ │ │ ├── section-shell.component.scss │ │ │ ├── section-shell.component.spec.ts │ │ │ └── section-shell.component.ts │ │ ├── ui-common.module.spec.ts │ │ └── ui-common.module.ts │ └── test-setup.ts │ ├── tsconfig.json │ ├── tsconfig.lib.json │ ├── tsconfig.spec.json │ └── tslint.json ├── nx.json ├── package-lock.json ├── package.json ├── tsconfig.json └── tslint.json /.editorconfig: -------------------------------------------------------------------------------- 1 | # Editor configuration, see http://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | indent_style = space 7 | indent_size = 2 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [*.md] 12 | max_line_length = off 13 | trim_trailing_whitespace = false 14 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # See http://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # compiled output 4 | /dist 5 | /tmp 6 | /out-tsc 7 | 8 | # dependencies 9 | /node_modules 10 | 11 | # IDEs and editors 12 | /.idea 13 | .project 14 | .classpath 15 | .c9/ 16 | *.launch 17 | .settings/ 18 | *.sublime-workspace 19 | 20 | # IDE - VSCode 21 | .vscode/* 22 | !.vscode/settings.json 23 | !.vscode/tasks.json 24 | !.vscode/launch.json 25 | !.vscode/extensions.json 26 | 27 | # misc 28 | /.sass-cache 29 | /connect.lock 30 | /coverage 31 | /libpeerconnection.log 32 | npm-debug.log 33 | yarn-error.log 34 | testem.log 35 | /typings 36 | .angular 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 | } 4 | -------------------------------------------------------------------------------- /.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": [ 3 | "nrwl.angular-console", 4 | "angular.ng-template", 5 | "ms-vscode.vscode-typescript-tslint-plugin", 6 | "esbenp.prettier-vscode" 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /apps/.gitkeep: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /apps/forms-course-e2e/cypress.json: -------------------------------------------------------------------------------- 1 | { 2 | "fileServerFolder": "../../dist/out-tsc/apps/forms-course-e2e", 3 | "fixturesFolder": "../../dist/out-tsc/apps/forms-course-e2e/src/fixtures", 4 | "integrationFolder": "../../dist/out-tsc/apps/forms-course-e2e/src/integration", 5 | "pluginsFile": "../../dist/out-tsc/apps/forms-course-e2e/src/plugins/index.js", 6 | "supportFile": false, 7 | "video": true, 8 | "videosFolder": "../../dist/out-tsc/apps/forms-course-e2e/videos", 9 | "screenshotsFolder": "../../dist/out-tsc/apps/forms-course-e2e/screenshots", 10 | "chromeWebSecurity": false 11 | } 12 | -------------------------------------------------------------------------------- /apps/forms-course-e2e/src/fixtures/example.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Using fixtures to represent data", 3 | "email": "hello@cypress.io" 4 | } 5 | -------------------------------------------------------------------------------- /apps/forms-course-e2e/src/integration/app.spec.ts: -------------------------------------------------------------------------------- 1 | import { getGreeting } from '../support/app.po'; 2 | 3 | describe('forms-course', () => { 4 | beforeEach(() => cy.visit('/')); 5 | 6 | it('should display welcome message', () => { 7 | getGreeting().contains('Welcome to forms-course!'); 8 | }); 9 | }); 10 | -------------------------------------------------------------------------------- /apps/forms-course-e2e/src/plugins/index.ts: -------------------------------------------------------------------------------- 1 | // *********************************************************** 2 | // This example plugins/index.js can be used to load plugins 3 | // 4 | // You can change the location of this file or turn off loading 5 | // the plugins file with the 'pluginsFile' configuration option. 6 | // 7 | // You can read more here: 8 | // https://on.cypress.io/plugins-guide 9 | // *********************************************************** 10 | 11 | // This function is called when a project is opened or re-opened (e.g. due to 12 | // the project's config changing) 13 | 14 | module.exports = (on: Cypress.Actions, config: Cypress.ConfigOptions) => { 15 | // `on` is used to hook into various events Cypress emits 16 | // `config` is the resolved Cypress config 17 | }; 18 | -------------------------------------------------------------------------------- /apps/forms-course-e2e/src/support/app.po.ts: -------------------------------------------------------------------------------- 1 | export const getGreeting = () => cy.get('h1'); 2 | -------------------------------------------------------------------------------- /apps/forms-course-e2e/src/support/commands.ts: -------------------------------------------------------------------------------- 1 | // *********************************************** 2 | // This example commands.js shows you how to 3 | // create various custom commands and overwrite 4 | // existing commands. 5 | // 6 | // For more comprehensive examples of custom 7 | // commands please read more here: 8 | // https://on.cypress.io/custom-commands 9 | // *********************************************** 10 | // 11 | // 12 | // -- This is a parent command -- 13 | // Cypress.Commands.add("login", (email, password) => { ... }) 14 | // 15 | // 16 | // -- This is a child command -- 17 | // Cypress.Commands.add("drag", { prevSubject: 'element'}, (subject, options) => { ... }) 18 | // 19 | // 20 | // -- This is a dual command -- 21 | // Cypress.Commands.add("dismiss", { prevSubject: 'optional'}, (subject, options) => { ... }) 22 | // 23 | // 24 | // -- This will overwrite an existing command -- 25 | // Cypress.Commands.overwrite("visit", (originalFn, url, options) => { ... }) 26 | -------------------------------------------------------------------------------- /apps/forms-course-e2e/src/support/index.ts: -------------------------------------------------------------------------------- 1 | // *********************************************************** 2 | // This example support/index.js is processed and 3 | // loaded automatically before your test files. 4 | // 5 | // This is a great place to put global configuration and 6 | // behavior that modifies Cypress. 7 | // 8 | // You can change the location of this file or turn off 9 | // automatically serving support files with the 10 | // 'supportFile' configuration option. 11 | // 12 | // You can read more here: 13 | // https://on.cypress.io/configuration 14 | // *********************************************************** 15 | 16 | // Import commands.js using ES2015 syntax: 17 | import './commands'; 18 | -------------------------------------------------------------------------------- /apps/forms-course-e2e/tsconfig.e2e.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "sourceMap": false, 5 | "outDir": "../../dist/out-tsc" 6 | }, 7 | "include": ["src/**/*.ts"] 8 | } 9 | -------------------------------------------------------------------------------- /apps/forms-course-e2e/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "types": ["cypress", "node"] 5 | }, 6 | "include": ["**/*.ts"] 7 | } 8 | -------------------------------------------------------------------------------- /apps/forms-course/browserslist: -------------------------------------------------------------------------------- 1 | # This file is used by the build system to adjust CSS and JS output to support the specified browsers below. 2 | # For additional information regarding the format and rule options, please see: 3 | # https://github.com/browserslist/browserslist#queries 4 | 5 | # You can see what browsers were selected by your queries by running: 6 | # npx browserslist 7 | 8 | > 0.5% 9 | last 2 versions 10 | Firefox ESR 11 | not dead 12 | not IE 9-11 # For IE 9-11 support, remove 'not'. -------------------------------------------------------------------------------- /apps/forms-course/jest.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | name: 'forms-course', 3 | preset: '../../jest.config.js', 4 | coverageDirectory: '../../coverage/apps/forms-course', 5 | snapshotSerializers: [ 6 | 'jest-preset-angular/AngularSnapshotSerializer.js', 7 | 'jest-preset-angular/HTMLCommentSerializer.js' 8 | ] 9 | }; 10 | -------------------------------------------------------------------------------- /apps/forms-course/src/app/app.component.html: -------------------------------------------------------------------------------- 1 | 2 |

Nrwl Forms Course

3 |
4 | 5 | 6 | 7 | {{ navLink.icon }}{{ navLink.text }} 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /apps/forms-course/src/app/app.component.scss: -------------------------------------------------------------------------------- 1 | mat-toolbar { 2 | background-color: #00a9f4; 3 | color: white; 4 | position: sticky; 5 | position: -webkit-sticky; 6 | top: 0; 7 | z-index: 1000; 8 | } 9 | 10 | mat-icon { 11 | margin-right: 15px; 12 | } 13 | 14 | mat-sidenav { 15 | margin-top: 64px; 16 | } 17 | 18 | mat-sidenav-content { 19 | min-height: calc(100vh - 64px); 20 | } 21 | 22 | .active { 23 | font-weight: bold; 24 | 25 | mat-icon { 26 | color: #96d7e8 !important; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /apps/forms-course/src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | import { Router } from '@angular/router'; 3 | 4 | @Component({ 5 | selector: 'forms-course-root', 6 | templateUrl: './app.component.html', 7 | styleUrls: ['./app.component.scss'] 8 | }) 9 | export class AppComponent { 10 | navLinks: { path: string; text: string; icon: string }[]; 11 | 12 | constructor(private router: Router) { 13 | this.navLinks = router.config 14 | .filter(x => !!x.data) 15 | .map(x => ({ 16 | path: x.path, 17 | text: x.data ? `${x.data.name} - ${x.data.subtitle}` : '', 18 | icon: x.data && x.data.icon 19 | })); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /apps/forms-course/src/assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nrwl/angular-reactive-forms-course/40af5ad1af54c453625f747e1ae20dc184ef10fd/apps/forms-course/src/assets/.gitkeep -------------------------------------------------------------------------------- /apps/forms-course/src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true 3 | }; 4 | -------------------------------------------------------------------------------- /apps/forms-course/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/forms-course/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nrwl/angular-reactive-forms-course/40af5ad1af54c453625f747e1ae20dc184ef10fd/apps/forms-course/src/favicon.ico -------------------------------------------------------------------------------- /apps/forms-course/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | FormsCourse 6 | 7 | 8 | 9 | 10 | 16 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /apps/forms-course/src/main.ts: -------------------------------------------------------------------------------- 1 | import { enableProdMode } from '@angular/core'; 2 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 3 | 4 | import { AppModule } from './app/app.module'; 5 | import { environment } from './environments/environment'; 6 | 7 | if (environment.production) { 8 | enableProdMode(); 9 | } 10 | 11 | platformBrowserDynamic() 12 | .bootstrapModule(AppModule) 13 | .catch(err => console.error(err)); 14 | -------------------------------------------------------------------------------- /apps/forms-course/src/styles.scss: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | @import '~@angular/material/prebuilt-themes/indigo-pink.css'; 3 | @import '~prismjs/themes/prism-twilight.css'; 4 | 5 | a, 6 | h1, 7 | h2, 8 | h3, 9 | h4, 10 | h5, 11 | p { 12 | font-family: Roboto, 'Helvetica Neue', sans-serif; 13 | } 14 | 15 | mat-card { 16 | margin: 40px; 17 | } 18 | 19 | .alert { 20 | margin: 40px; 21 | max-width: 1250px; 22 | } 23 | 24 | .alert-link { 25 | color: #96d7e8 !important; 26 | } 27 | -------------------------------------------------------------------------------- /apps/forms-course/src/test-setup.ts: -------------------------------------------------------------------------------- 1 | import 'jest-preset-angular'; 2 | -------------------------------------------------------------------------------- /apps/forms-course/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../dist/out-tsc", 5 | "types": ["node"] 6 | }, 7 | "include": [ 8 | "**/*.ts", 9 | "../../libs/section1/src/index.ts", 10 | "../../libs/section2/src/index.ts", 11 | 12 | "../../libs/section5/src/index.ts", 13 | 14 | "../../libs/section3/src/index.ts", 15 | 16 | "../../libs/section4/src/index.ts", 17 | 18 | "../../libs/section6/src/index.ts" 19 | ], 20 | "exclude": ["src/test-setup.ts", "**/*.spec.ts"] 21 | } 22 | -------------------------------------------------------------------------------- /apps/forms-course/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "types": ["node", "jest"] 5 | }, 6 | "include": ["**/*.ts"] 7 | } 8 | -------------------------------------------------------------------------------- /apps/forms-course/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../dist/out-tsc", 5 | "module": "commonjs", 6 | "types": ["jest", "node"] 7 | }, 8 | "files": ["src/test-setup.ts"], 9 | "include": ["**/*.spec.ts", "**/*.d.ts"] 10 | } 11 | -------------------------------------------------------------------------------- /apps/forms-course/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tslint.json", 3 | "rules": { 4 | "directive-selector": [true, "attribute", "formsCourse", "camelCase"], 5 | "component-selector": [true, "element", "forms-course", "kebab-case"] 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /jest.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | testMatch: ['**/+(*.)+(spec|test).+(ts|js)?(x)'], 3 | transform: { 4 | '^.+\\.(ts|js|html)$': 'ts-jest' 5 | }, 6 | resolver: '@nrwl/jest/plugins/resolver', 7 | moduleFileExtensions: ['ts', 'js', 'html'], 8 | collectCoverage: true, 9 | coverageReporters: ['html'] 10 | }; 11 | -------------------------------------------------------------------------------- /libs/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nrwl/angular-reactive-forms-course/40af5ad1af54c453625f747e1ae20dc184ef10fd/libs/.gitkeep -------------------------------------------------------------------------------- /libs/section1/README.md: -------------------------------------------------------------------------------- 1 | # section1 2 | 3 | This library was generated with [Nx](https://nx.dev). 4 | 5 | ## Running unit tests 6 | 7 | Run `ng test section1` to execute the unit tests. 8 | -------------------------------------------------------------------------------- /libs/section1/jest.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | name: 'section1', 3 | preset: '../../jest.config.js', 4 | coverageDirectory: '../../coverage/libs/section1', 5 | snapshotSerializers: [ 6 | 'jest-preset-angular/AngularSnapshotSerializer.js', 7 | 'jest-preset-angular/HTMLCommentSerializer.js' 8 | ] 9 | }; 10 | -------------------------------------------------------------------------------- /libs/section1/src/index.ts: -------------------------------------------------------------------------------- 1 | export * from './lib/section1.module'; 2 | -------------------------------------------------------------------------------- /libs/section1/src/lib/lesson1/completed/lesson1-completed-making-forms-dynamic/lesson1-completed-making-forms-dynamic.component.css: -------------------------------------------------------------------------------- 1 | textarea { 2 | width: 100%; 3 | } 4 | -------------------------------------------------------------------------------- /libs/section1/src/lib/lesson1/completed/lesson1-completed-making-forms-dynamic/lesson1-completed-making-forms-dynamic.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import { FormControl } from '@angular/forms'; 3 | 4 | @Component({ 5 | selector: 'forms-course-lesson1-completed-making-forms-dynamic', 6 | templateUrl: './lesson1-completed-making-forms-dynamic.component.html', 7 | styleUrls: ['./lesson1-completed-making-forms-dynamic.component.css'] 8 | }) 9 | export class Lesson1CompletedMakingFormsDynamicComponent implements OnInit { 10 | favoriteColor = new FormControl('Blue'); 11 | colors = ['Blue', 'Red', 'White', 'Orange', 'Purple', 'Yellow', 'Chartreuse']; 12 | allColors = new FormControl(this.colors.join(', ')); 13 | 14 | constructor() {} 15 | 16 | ngOnInit() {} 17 | } 18 | -------------------------------------------------------------------------------- /libs/section1/src/lib/lesson1/completed/lesson1-completed-number-input/lesson1-completed-number-input.component.css: -------------------------------------------------------------------------------- 1 | input { 2 | width: 50px; 3 | } 4 | -------------------------------------------------------------------------------- /libs/section1/src/lib/lesson1/completed/lesson1-completed-number-input/lesson1-completed-number-input.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { Lesson1CompletedNumberInputComponent } from './lesson1-completed-number-input.component'; 4 | 5 | describe('Lesson1CompletedNumberInputComponent', () => { 6 | let component: Lesson1CompletedNumberInputComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ Lesson1CompletedNumberInputComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(Lesson1CompletedNumberInputComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /libs/section1/src/lib/lesson1/completed/lesson1-completed-other-controls/lesson1-completed-other-controls.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nrwl/angular-reactive-forms-course/40af5ad1af54c453625f747e1ae20dc184ef10fd/libs/section1/src/lib/lesson1/completed/lesson1-completed-other-controls/lesson1-completed-other-controls.component.css -------------------------------------------------------------------------------- /libs/section1/src/lib/lesson1/completed/lesson1-completed-other-controls/lesson1-completed-other-controls.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { Lesson1CompletedOtherControlsComponent } from './lesson1-completed-other-controls.component'; 4 | 5 | describe('Lesson1CompletedOtherControlsComponent', () => { 6 | let component: Lesson1CompletedOtherControlsComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ Lesson1CompletedOtherControlsComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(Lesson1CompletedOtherControlsComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /libs/section1/src/lib/lesson1/completed/lesson1-completed-other-controls/lesson1-completed-other-controls.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import { FormControl } from '@angular/forms'; 3 | 4 | @Component({ 5 | selector: 'forms-course-lesson1-completed-other-controls', 6 | templateUrl: './lesson1-completed-other-controls.component.html', 7 | styleUrls: ['./lesson1-completed-other-controls.component.css'] 8 | }) 9 | export class Lesson1CompletedOtherControlsComponent implements OnInit { 10 | radioControl = new FormControl('Blue'); 11 | selectControl = new FormControl('Blue'); 12 | rangeControl = new FormControl(5); 13 | dateControl = new FormControl('2019-08-13'); 14 | timeControl = new FormControl('09:00'); 15 | colorControl = new FormControl('#0096ff'); 16 | 17 | constructor() {} 18 | 19 | ngOnInit() {} 20 | } 21 | -------------------------------------------------------------------------------- /libs/section1/src/lib/lesson1/completed/lesson1-completed-shell/lesson1-completed-shell.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nrwl/angular-reactive-forms-course/40af5ad1af54c453625f747e1ae20dc184ef10fd/libs/section1/src/lib/lesson1/completed/lesson1-completed-shell/lesson1-completed-shell.component.css -------------------------------------------------------------------------------- /libs/section1/src/lib/lesson1/completed/lesson1-completed-shell/lesson1-completed-shell.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { Lesson1CompletedShellComponent } from './lesson1-completed-shell.component'; 4 | 5 | describe('Lesson1CompletedShellComponent', () => { 6 | let component: Lesson1CompletedShellComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ Lesson1CompletedShellComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(Lesson1CompletedShellComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /libs/section1/src/lib/lesson1/completed/lesson1-completed-text-input/lesson1-completed-text-input.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nrwl/angular-reactive-forms-course/40af5ad1af54c453625f747e1ae20dc184ef10fd/libs/section1/src/lib/lesson1/completed/lesson1-completed-text-input/lesson1-completed-text-input.component.css -------------------------------------------------------------------------------- /libs/section1/src/lib/lesson1/completed/lesson1-completed-text-input/lesson1-completed-text-input.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { Lesson1CompletedTextInputComponent } from './lesson1-completed-text-input.component'; 4 | 5 | describe('Lesson1CompletedTextInputComponent', () => { 6 | let component: Lesson1CompletedTextInputComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ Lesson1CompletedTextInputComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(Lesson1CompletedTextInputComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /libs/section1/src/lib/lesson1/making-forms-dynamic/making-forms-dynamic.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nrwl/angular-reactive-forms-course/40af5ad1af54c453625f747e1ae20dc184ef10fd/libs/section1/src/lib/lesson1/making-forms-dynamic/making-forms-dynamic.component.css -------------------------------------------------------------------------------- /libs/section1/src/lib/lesson1/making-forms-dynamic/making-forms-dynamic.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { MakingFormsDynamicComponent } from './making-forms-dynamic.component'; 4 | 5 | describe('MakingFormsDynamicComponent', () => { 6 | let component: MakingFormsDynamicComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ MakingFormsDynamicComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(MakingFormsDynamicComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /libs/section1/src/lib/lesson1/making-forms-dynamic/making-forms-dynamic.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import { FormControl } from '@angular/forms'; 3 | 4 | @Component({ 5 | selector: 'forms-course-making-forms-dynamic', 6 | templateUrl: './making-forms-dynamic.component.html', 7 | styleUrls: ['./making-forms-dynamic.component.css'] 8 | }) 9 | export class MakingFormsDynamicComponent { 10 | favoriteColor = new FormControl('Blue'); 11 | colors = ['Blue', 'Red', 'White', 'Orange', 'Purple', 'Yellow', 'Chartreuse']; 12 | } 13 | -------------------------------------------------------------------------------- /libs/section1/src/lib/lesson1/number-input/number-input.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nrwl/angular-reactive-forms-course/40af5ad1af54c453625f747e1ae20dc184ef10fd/libs/section1/src/lib/lesson1/number-input/number-input.component.css -------------------------------------------------------------------------------- /libs/section1/src/lib/lesson1/number-input/number-input.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { NumberInputComponent } from './number-input.component'; 4 | 5 | describe('NumberInputComponent', () => { 6 | let component: NumberInputComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ NumberInputComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(NumberInputComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /libs/section1/src/lib/lesson1/number-input/number-input.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'forms-course-number-input', 5 | templateUrl: './number-input.component.html', 6 | styleUrls: ['./number-input.component.css'] 7 | }) 8 | export class NumberInputComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /libs/section1/src/lib/lesson1/other-controls/other-controls.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nrwl/angular-reactive-forms-course/40af5ad1af54c453625f747e1ae20dc184ef10fd/libs/section1/src/lib/lesson1/other-controls/other-controls.component.css -------------------------------------------------------------------------------- /libs/section1/src/lib/lesson1/other-controls/other-controls.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { OtherControlsComponent } from './other-controls.component'; 4 | 5 | describe('OtherControlsComponent', () => { 6 | let component: OtherControlsComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ OtherControlsComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(OtherControlsComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /libs/section1/src/lib/lesson1/other-controls/other-controls.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import { FormControl } from '@angular/forms'; 3 | 4 | @Component({ 5 | selector: 'forms-course-other-controls', 6 | templateUrl: './other-controls.component.html', 7 | styleUrls: ['./other-controls.component.css'] 8 | }) 9 | export class OtherControlsComponent implements OnInit { 10 | radioControl = new FormControl('Blue'); 11 | selectControl = new FormControl('Blue'); 12 | rangeControl = new FormControl(5); 13 | dateControl = new FormControl('2019-08-13'); 14 | timeControl = new FormControl('09:00'); 15 | colorControl = new FormControl('#0096ff'); 16 | 17 | constructor() {} 18 | 19 | ngOnInit() {} 20 | } 21 | -------------------------------------------------------------------------------- /libs/section1/src/lib/lesson1/text-input/text-input.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nrwl/angular-reactive-forms-course/40af5ad1af54c453625f747e1ae20dc184ef10fd/libs/section1/src/lib/lesson1/text-input/text-input.component.css -------------------------------------------------------------------------------- /libs/section1/src/lib/lesson1/text-input/text-input.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { TextInputComponent } from './text-input.component'; 4 | 5 | describe('TextInputComponent', () => { 6 | let component: TextInputComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ TextInputComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(TextInputComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /libs/section1/src/lib/lesson1/text-input/text-input.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, OnDestroy } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'forms-course-text-input', 5 | templateUrl: './text-input.component.html', 6 | styleUrls: ['./text-input.component.css'] 7 | }) 8 | export class TextInputComponent implements OnInit, OnDestroy { 9 | constructor() {} 10 | 11 | ngOnInit() {} 12 | 13 | ngOnDestroy() {} 14 | 15 | setFormToMyName() {} 16 | 17 | toggleFormEnabled() {} 18 | 19 | clearHistory() {} 20 | } 21 | -------------------------------------------------------------------------------- /libs/section1/src/lib/lesson2/completed/lesson2-completed-filtering-a-list/lesson2-completed-filtering-a-list.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nrwl/angular-reactive-forms-course/40af5ad1af54c453625f747e1ae20dc184ef10fd/libs/section1/src/lib/lesson2/completed/lesson2-completed-filtering-a-list/lesson2-completed-filtering-a-list.component.css -------------------------------------------------------------------------------- /libs/section1/src/lib/lesson2/completed/lesson2-completed-filtering-a-list/lesson2-completed-filtering-a-list.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { Lesson2CompletedFilteringAListComponent } from './lesson2-completed-filtering-a-list.component'; 4 | 5 | describe('Lesson2CompletedFilteringAListComponent', () => { 6 | let component: Lesson2CompletedFilteringAListComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ Lesson2CompletedFilteringAListComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(Lesson2CompletedFilteringAListComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /libs/section1/src/lib/lesson2/completed/lesson2-completed-hero-form/lesson2-completed-hero-form.component.css: -------------------------------------------------------------------------------- 1 | legend { 2 | background-color: #000; 3 | color: #fff; 4 | padding: 3px 6px; 5 | text-align: center; 6 | } 7 | 8 | fieldset { 9 | border-width: 3px; 10 | border-style: solid; 11 | border-radius: 5px; 12 | margin: 10px; 13 | padding: 10px; 14 | } 15 | 16 | label { 17 | width: 200px; 18 | } 19 | -------------------------------------------------------------------------------- /libs/section1/src/lib/lesson2/completed/lesson2-completed-hero-form/lesson2-completed-hero-form.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { Lesson2CompletedHeroFormComponent } from './lesson2-completed-hero-form.component'; 4 | 5 | describe('Lesson2CompletedPokemonFormComponent', () => { 6 | let component: Lesson2CompletedHeroFormComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [Lesson2CompletedHeroFormComponent] 12 | }).compileComponents(); 13 | })); 14 | 15 | beforeEach(() => { 16 | fixture = TestBed.createComponent(Lesson2CompletedHeroFormComponent); 17 | component = fixture.componentInstance; 18 | fixture.detectChanges(); 19 | }); 20 | 21 | it('should create', () => { 22 | expect(component).toBeTruthy(); 23 | }); 24 | }); 25 | -------------------------------------------------------------------------------- /libs/section1/src/lib/lesson2/filtering-a-list/filtering-a-list.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nrwl/angular-reactive-forms-course/40af5ad1af54c453625f747e1ae20dc184ef10fd/libs/section1/src/lib/lesson2/filtering-a-list/filtering-a-list.component.css -------------------------------------------------------------------------------- /libs/section1/src/lib/lesson2/filtering-a-list/filtering-a-list.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { FilteringAListComponent } from './filtering-a-list.component'; 4 | 5 | describe('FilteringAListComponent', () => { 6 | let component: FilteringAListComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ FilteringAListComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(FilteringAListComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /libs/section1/src/lib/lesson2/hero-form/hero-form.component.css: -------------------------------------------------------------------------------- 1 | legend { 2 | background-color: #000; 3 | color: #fff; 4 | padding: 3px 6px; 5 | text-align: center; 6 | } 7 | 8 | fieldset { 9 | border-width: 3px; 10 | border-style: solid; 11 | border-radius: 5px; 12 | margin: 10px; 13 | padding: 10px; 14 | } 15 | 16 | label { 17 | width: 200px; 18 | } 19 | -------------------------------------------------------------------------------- /libs/section1/src/lib/lesson2/hero-form/hero-form.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { HeroFormComponent } from './hero-form.component'; 4 | 5 | describe('HeroFormComponent', () => { 6 | let component: HeroFormComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ HeroFormComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(HeroFormComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /libs/section1/src/lib/lesson2/hero-form/hero-form.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | export interface Hero { 4 | name: string; 5 | stats: { 6 | attack: number; 7 | defense: number; 8 | speed: number; 9 | health: number; 10 | }; 11 | } 12 | 13 | @Component({ 14 | selector: 'forms-course-hero-form', 15 | templateUrl: './hero-form.component.html', 16 | styleUrls: ['./hero-form.component.css'] 17 | }) 18 | export class HeroFormComponent { 19 | constructor() {} 20 | } 21 | -------------------------------------------------------------------------------- /libs/section1/src/lib/lesson2/lesson2-shell/lesson2-shell.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nrwl/angular-reactive-forms-course/40af5ad1af54c453625f747e1ae20dc184ef10fd/libs/section1/src/lib/lesson2/lesson2-shell/lesson2-shell.component.css -------------------------------------------------------------------------------- /libs/section1/src/lib/lesson2/lesson2-shell/lesson2-shell.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { Lesson2ShellComponent } from './lesson2-shell.component'; 4 | 5 | describe('Lesson2ShellComponent', () => { 6 | let component: Lesson2ShellComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ Lesson2ShellComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(Lesson2ShellComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /libs/section1/src/lib/lesson3/completed/lesson3-completed-party-form/lesson3-completed-party-form.component.css: -------------------------------------------------------------------------------- 1 | legend { 2 | background-color: #000; 3 | color: #fff; 4 | padding: 3px 6px; 5 | text-align: center; 6 | } 7 | 8 | fieldset { 9 | border-width: 3px; 10 | border-style: solid; 11 | border-radius: 5px; 12 | margin: 10px; 13 | padding: 10px; 14 | } 15 | 16 | label { 17 | width: 200px; 18 | } 19 | 20 | .hero-container { 21 | display: grid; 22 | grid-template-columns: 1fr 1fr; 23 | grid-column-gap: 0px; 24 | grid-row-gap: 0px; 25 | } 26 | -------------------------------------------------------------------------------- /libs/section1/src/lib/lesson3/completed/lesson3-completed-party-form/lesson3-completed-party-form.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { Lesson3CompletedPartyFormComponent } from './lesson3-completed-party-form.component'; 4 | 5 | describe('Lesson3CompletedPartyFormComponent', () => { 6 | let component: Lesson3CompletedPartyFormComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ Lesson3CompletedPartyFormComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(Lesson3CompletedPartyFormComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /libs/section1/src/lib/lesson3/completed/lesson3-completed-simple-dynamic-array/lesson3-completed-simple-dynamic-array.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nrwl/angular-reactive-forms-course/40af5ad1af54c453625f747e1ae20dc184ef10fd/libs/section1/src/lib/lesson3/completed/lesson3-completed-simple-dynamic-array/lesson3-completed-simple-dynamic-array.component.css -------------------------------------------------------------------------------- /libs/section1/src/lib/lesson3/completed/lesson3-completed-simple-dynamic-array/lesson3-completed-simple-dynamic-array.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import { FormArray, FormControl } from '@angular/forms'; 3 | 4 | @Component({ 5 | selector: 'forms-course-lesson3-completed-simple-dynamic-array', 6 | templateUrl: './lesson3-completed-simple-dynamic-array.component.html', 7 | styleUrls: ['./lesson3-completed-simple-dynamic-array.component.css'] 8 | }) 9 | export class Lesson3CompletedSimpleDynamicArrayComponent implements OnInit { 10 | form = new FormArray([new FormControl('')]); 11 | 12 | ngOnInit() {} 13 | 14 | addControl() { 15 | this.form.push(new FormControl('')); 16 | } 17 | 18 | removeControl(index: number) { 19 | this.form.removeAt(index); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /libs/section1/src/lib/lesson3/lesson3-shell/lesson3-shell.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nrwl/angular-reactive-forms-course/40af5ad1af54c453625f747e1ae20dc184ef10fd/libs/section1/src/lib/lesson3/lesson3-shell/lesson3-shell.component.css -------------------------------------------------------------------------------- /libs/section1/src/lib/lesson3/lesson3-shell/lesson3-shell.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { Lesson3ShellComponent } from './lesson3-shell.component'; 4 | 5 | describe('Lesson3ShellComponent', () => { 6 | let component: Lesson3ShellComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ Lesson3ShellComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(Lesson3ShellComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /libs/section1/src/lib/lesson3/party-form/party-form.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nrwl/angular-reactive-forms-course/40af5ad1af54c453625f747e1ae20dc184ef10fd/libs/section1/src/lib/lesson3/party-form/party-form.component.css -------------------------------------------------------------------------------- /libs/section1/src/lib/lesson3/party-form/party-form.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { PartyFormComponent } from './party-form.component'; 4 | 5 | describe('PartyFormComponent', () => { 6 | let component: PartyFormComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ PartyFormComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(PartyFormComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /libs/section1/src/lib/lesson3/simple-dynamic-array/simple-dynamic-array.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nrwl/angular-reactive-forms-course/40af5ad1af54c453625f747e1ae20dc184ef10fd/libs/section1/src/lib/lesson3/simple-dynamic-array/simple-dynamic-array.component.css -------------------------------------------------------------------------------- /libs/section1/src/lib/lesson3/simple-dynamic-array/simple-dynamic-array.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { SimpleDynamicArrayComponent } from './simple-dynamic-array.component'; 4 | 5 | describe('SimpleDynamicArrayComponent', () => { 6 | let component: SimpleDynamicArrayComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ SimpleDynamicArrayComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(SimpleDynamicArrayComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /libs/section1/src/lib/lesson3/simple-dynamic-array/simple-dynamic-array.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'forms-course-simple-dynamic-array', 5 | templateUrl: './simple-dynamic-array.component.html', 6 | styleUrls: ['./simple-dynamic-array.component.css'] 7 | }) 8 | export class SimpleDynamicArrayComponent implements OnInit { 9 | constructor() {} 10 | 11 | ngOnInit() {} 12 | 13 | addControl() {} 14 | 15 | removeControl(index: number) {} 16 | } 17 | -------------------------------------------------------------------------------- /libs/section1/src/lib/section1.module.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, TestBed } from '@angular/core/testing'; 2 | import { Section1Module } from './section1.module'; 3 | 4 | describe('Section1Module', () => { 5 | beforeEach(async(() => { 6 | TestBed.configureTestingModule({ 7 | imports: [Section1Module] 8 | }).compileComponents(); 9 | })); 10 | 11 | it('should create', () => { 12 | expect(Section1Module).toBeDefined(); 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /libs/section1/src/test-setup.ts: -------------------------------------------------------------------------------- 1 | import 'jest-preset-angular'; 2 | -------------------------------------------------------------------------------- /libs/section1/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "types": ["node", "jest"] 5 | }, 6 | "include": ["**/*.ts"] 7 | } 8 | -------------------------------------------------------------------------------- /libs/section1/tsconfig.lib.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../dist/out-tsc", 5 | "target": "es2015", 6 | "declaration": true, 7 | "inlineSources": true, 8 | "types": ["node"], 9 | "lib": ["dom", "es2018"] 10 | }, 11 | "angularCompilerOptions": { 12 | "annotateForClosureCompiler": true, 13 | "skipTemplateCodegen": true, 14 | "strictMetadataEmit": true, 15 | "fullTemplateTypeCheck": true, 16 | "strictInjectionParameters": true, 17 | "enableResourceInlining": true 18 | }, 19 | "exclude": ["src/test.ts", "**/*.spec.ts"] 20 | } 21 | -------------------------------------------------------------------------------- /libs/section1/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../dist/out-tsc", 5 | "module": "commonjs", 6 | "types": ["jest", "node"] 7 | }, 8 | "files": ["src/test-setup.ts"], 9 | "include": ["**/*.spec.ts", "**/*.d.ts"] 10 | } 11 | -------------------------------------------------------------------------------- /libs/section1/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tslint.json", 3 | "rules": { 4 | "directive-selector": [true, "attribute", "formsCourse", "camelCase"], 5 | "component-selector": [true, "element", "forms-course", "kebab-case"] 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /libs/section2/README.md: -------------------------------------------------------------------------------- 1 | # section2 2 | 3 | This library was generated with [Nx](https://nx.dev). 4 | 5 | ## Running unit tests 6 | 7 | Run `ng test section2` to execute the unit tests. 8 | -------------------------------------------------------------------------------- /libs/section2/jest.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | name: 'section2', 3 | preset: '../../jest.config.js', 4 | coverageDirectory: '../../coverage/libs/section2', 5 | snapshotSerializers: [ 6 | 'jest-preset-angular/AngularSnapshotSerializer.js', 7 | 'jest-preset-angular/HTMLCommentSerializer.js' 8 | ] 9 | }; 10 | -------------------------------------------------------------------------------- /libs/section2/src/index.ts: -------------------------------------------------------------------------------- 1 | export * from './lib/section2.module'; 2 | -------------------------------------------------------------------------------- /libs/section2/src/lib/+state/hero.actions.ts: -------------------------------------------------------------------------------- 1 | import { createAction, props } from '@ngrx/store'; 2 | 3 | export const createHero = createAction( 4 | 'create hero', 5 | props<{ name: string }>() 6 | ); 7 | -------------------------------------------------------------------------------- /libs/section2/src/lib/+state/hero.reducer.ts: -------------------------------------------------------------------------------- 1 | import { createReducer, on, Action } from '@ngrx/store'; 2 | import { createHero } from './hero.actions'; 3 | 4 | const reducer = createReducer( 5 | [], 6 | on(createHero, (state, { name }) => [...state, name]) 7 | ); 8 | 9 | export function heroReducer(state: any[], action: Action) { 10 | return reducer(state, action); 11 | } 12 | -------------------------------------------------------------------------------- /libs/section2/src/lib/+state/hero.selector.ts: -------------------------------------------------------------------------------- 1 | import { createFeatureSelector } from '@ngrx/store'; 2 | 3 | export const heroSelector = createFeatureSelector('hero'); 4 | -------------------------------------------------------------------------------- /libs/section2/src/lib/api.service.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed } from '@angular/core/testing'; 2 | 3 | import { ApiService } from './api.service'; 4 | 5 | describe('ApiService', () => { 6 | beforeEach(() => TestBed.configureTestingModule({})); 7 | 8 | it('should be created', () => { 9 | const service: ApiService = TestBed.get(ApiService); 10 | expect(service).toBeTruthy(); 11 | }); 12 | }); 13 | -------------------------------------------------------------------------------- /libs/section2/src/lib/api.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | import { of } from 'rxjs'; 3 | import { map, delay } from 'rxjs/operators'; 4 | import * as deepEqual from 'deep-equal'; 5 | 6 | const USERS = [ 7 | { first: 'Jeff', middle: 'Brian', last: 'Cross' }, 8 | { first: 'Jeff', middle: '', last: 'Cross' }, 9 | { first: 'Zack', middle: 'Danger', last: 'Rose' } 10 | ]; 11 | 12 | @Injectable({ 13 | providedIn: 'root' 14 | }) 15 | export class ApiService { 16 | public alreadyExists$ = (name: { 17 | first: string; 18 | middle: string; 19 | last: string; 20 | }) => 21 | of(USERS).pipe( 22 | map(users => users.some(x => deepEqual(x, name))), 23 | delay(2000) 24 | ); 25 | } 26 | -------------------------------------------------------------------------------- /libs/section2/src/lib/lesson1/completed/lesson1-completed-hero-validation/lesson1-completed-hero-validation.component.css: -------------------------------------------------------------------------------- 1 | legend { 2 | background-color: #000; 3 | color: #fff; 4 | padding: 3px 6px; 5 | text-align: center; 6 | } 7 | 8 | fieldset { 9 | border-width: 3px; 10 | border-style: solid; 11 | border-radius: 5px; 12 | margin: 10px; 13 | padding: 10px; 14 | } 15 | 16 | label { 17 | width: 200px; 18 | } 19 | 20 | td { 21 | border-style: solid; 22 | border-width: 2px; 23 | } 24 | 25 | pre { 26 | margin: 0; 27 | } 28 | -------------------------------------------------------------------------------- /libs/section2/src/lib/lesson1/completed/lesson1-completed-hero-validation/lesson1-completed-hero-validation.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { Lesson1CompletedHeroValidationComponent } from './lesson1-completed-hero-validation.component'; 4 | 5 | describe('Lesson1CompletedHeroValidationComponent', () => { 6 | let component: Lesson1CompletedHeroValidationComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ Lesson1CompletedHeroValidationComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(Lesson1CompletedHeroValidationComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /libs/section2/src/lib/lesson1/completed/lesson1-completed-simple-built-in-validators/lesson1-completed-simple-built-in-validators.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nrwl/angular-reactive-forms-course/40af5ad1af54c453625f747e1ae20dc184ef10fd/libs/section2/src/lib/lesson1/completed/lesson1-completed-simple-built-in-validators/lesson1-completed-simple-built-in-validators.component.css -------------------------------------------------------------------------------- /libs/section2/src/lib/lesson1/completed/lesson1-completed-simple-built-in-validators/lesson1-completed-simple-built-in-validators.component.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |
errors: {{ control.errors | json }}
5 |
status: {{ control.status | json }}
6 | -------------------------------------------------------------------------------- /libs/section2/src/lib/lesson1/completed/lesson1-completed-simple-built-in-validators/lesson1-completed-simple-built-in-validators.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import { FormControl, Validators } from '@angular/forms'; 3 | 4 | @Component({ 5 | selector: 'forms-course-lesson1-completed-simple-built-in-validators', 6 | templateUrl: './lesson1-completed-simple-built-in-validators.component.html', 7 | styleUrls: ['./lesson1-completed-simple-built-in-validators.component.css'] 8 | }) 9 | export class Lesson1CompletedSimpleBuiltInValidatorsComponent 10 | implements OnInit { 11 | control = new FormControl('', [ 12 | Validators.required, 13 | Validators.minLength(5), 14 | Validators.email 15 | ]); 16 | 17 | constructor() {} 18 | 19 | ngOnInit() {} 20 | } 21 | -------------------------------------------------------------------------------- /libs/section2/src/lib/lesson1/hero-validation/hero-validation.component.css: -------------------------------------------------------------------------------- 1 | legend { 2 | background-color: #000; 3 | color: #fff; 4 | padding: 3px 6px; 5 | text-align: center; 6 | } 7 | 8 | fieldset { 9 | border-width: 3px; 10 | border-style: solid; 11 | border-radius: 5px; 12 | margin: 10px; 13 | padding: 10px; 14 | } 15 | 16 | label { 17 | width: 200px; 18 | } 19 | 20 | td { 21 | border-style: solid; 22 | border-width: 2px; 23 | } 24 | 25 | pre { 26 | margin: 0; 27 | } 28 | -------------------------------------------------------------------------------- /libs/section2/src/lib/lesson1/hero-validation/hero-validation.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { HeroValidationComponent } from './hero-validation.component'; 4 | 5 | describe('HeroValidationComponent', () => { 6 | let component: HeroValidationComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ HeroValidationComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(HeroValidationComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /libs/section2/src/lib/lesson1/hero-validation/hero-validation.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import { ValidatorFn } from '@angular/forms'; 3 | 4 | interface Hero { 5 | name: string; 6 | stats: { 7 | attack: number; 8 | defense: number; 9 | speed: number; 10 | health: number; 11 | }; 12 | } 13 | 14 | const MIN_STAT_THRESHOLD = 0; 15 | const MAX_STAT_THRESHOLD = 20; 16 | const statValidators: ValidatorFn[] = []; 17 | 18 | @Component({ 19 | selector: 'forms-course-hero-validation', 20 | templateUrl: './hero-validation.component.html', 21 | styleUrls: ['./hero-validation.component.css'] 22 | }) 23 | export class HeroValidationComponent implements OnInit { 24 | stats = ['attack', 'defense', 'speed', 'health']; 25 | constructor() {} 26 | 27 | ngOnInit() {} 28 | } 29 | -------------------------------------------------------------------------------- /libs/section2/src/lib/lesson1/lesson1-shell/lesson1-shell.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nrwl/angular-reactive-forms-course/40af5ad1af54c453625f747e1ae20dc184ef10fd/libs/section2/src/lib/lesson1/lesson1-shell/lesson1-shell.component.css -------------------------------------------------------------------------------- /libs/section2/src/lib/lesson1/lesson1-shell/lesson1-shell.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { Lesson1ShellComponent } from './lesson1-shell.component'; 4 | 5 | describe('Lesson1ShellComponent', () => { 6 | let component: Lesson1ShellComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ Lesson1ShellComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(Lesson1ShellComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /libs/section2/src/lib/lesson1/simple-built-in-validators/simple-built-in-validators.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nrwl/angular-reactive-forms-course/40af5ad1af54c453625f747e1ae20dc184ef10fd/libs/section2/src/lib/lesson1/simple-built-in-validators/simple-built-in-validators.component.css -------------------------------------------------------------------------------- /libs/section2/src/lib/lesson1/simple-built-in-validators/simple-built-in-validators.component.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |
errors: [[ show errors here ]]
5 |
status: [[ show form status here ]]
6 | -------------------------------------------------------------------------------- /libs/section2/src/lib/lesson1/simple-built-in-validators/simple-built-in-validators.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { SimpleBuiltInValidatorsComponent } from './simple-built-in-validators.component'; 4 | 5 | describe('SimpleBuiltInValidatorsComponent', () => { 6 | let component: SimpleBuiltInValidatorsComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ SimpleBuiltInValidatorsComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(SimpleBuiltInValidatorsComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /libs/section2/src/lib/lesson1/simple-built-in-validators/simple-built-in-validators.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'forms-course-simple-built-in-validators', 5 | templateUrl: './simple-built-in-validators.component.html', 6 | styleUrls: ['./simple-built-in-validators.component.css'] 7 | }) 8 | export class SimpleBuiltInValidatorsComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /libs/section2/src/lib/lesson2/bootstap-example/bootstap-example.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nrwl/angular-reactive-forms-course/40af5ad1af54c453625f747e1ae20dc184ef10fd/libs/section2/src/lib/lesson2/bootstap-example/bootstap-example.component.css -------------------------------------------------------------------------------- /libs/section2/src/lib/lesson2/bootstap-example/bootstap-example.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | 4 | 5 |
6 |
7 | Some input is required. 8 |
9 |
10 | Input must be less than [[ max allowed length]] characters. 11 |
12 |
13 |
14 | 17 |
18 | -------------------------------------------------------------------------------- /libs/section2/src/lib/lesson2/bootstap-example/bootstap-example.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { BootstapExampleComponent } from './bootstap-example.component'; 4 | 5 | describe('BootstapExampleComponent', () => { 6 | let component: BootstapExampleComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ BootstapExampleComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(BootstapExampleComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /libs/section2/src/lib/lesson2/bootstap-example/bootstap-example.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import { FormGroup, FormControl, Validators } from '@angular/forms'; 3 | 4 | @Component({ 5 | selector: 'forms-course-bootstap-example', 6 | templateUrl: './bootstap-example.component.html', 7 | styleUrls: ['./bootstap-example.component.css'] 8 | }) 9 | export class BootstapExampleComponent { 10 | form = new FormGroup({ 11 | input: new FormControl('', [Validators.required, Validators.maxLength(10)]) 12 | }); 13 | 14 | submit() { 15 | alert('Submitted!'); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /libs/section2/src/lib/lesson2/completed/lesson2-completed-bootstrap-example/lesson2-completed-bootstrap-example.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nrwl/angular-reactive-forms-course/40af5ad1af54c453625f747e1ae20dc184ef10fd/libs/section2/src/lib/lesson2/completed/lesson2-completed-bootstrap-example/lesson2-completed-bootstrap-example.component.css -------------------------------------------------------------------------------- /libs/section2/src/lib/lesson2/completed/lesson2-completed-bootstrap-example/lesson2-completed-bootstrap-example.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | 4 | 12 |
13 |
14 | Some input is required. 15 |
16 |
17 | Input must be less than {{ maxlength.requiredLength }} characters. 18 |
19 |
20 |
21 | 24 |
25 | -------------------------------------------------------------------------------- /libs/section2/src/lib/lesson2/completed/lesson2-completed-bootstrap-example/lesson2-completed-bootstrap-example.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | import { FormControl, Validators, FormGroup } from '@angular/forms'; 3 | 4 | @Component({ 5 | selector: 'forms-course-lesson2-completed-bootstrap-example', 6 | templateUrl: './lesson2-completed-bootstrap-example.component.html', 7 | styleUrls: ['./lesson2-completed-bootstrap-example.component.css'] 8 | }) 9 | export class Lesson2CompletedBootstrapExampleComponent { 10 | form = new FormGroup({ 11 | input: new FormControl('', [Validators.required, Validators.maxLength(10)]) 12 | }); 13 | 14 | submit() { 15 | alert('Submitted!'); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /libs/section2/src/lib/lesson2/completed/lesson2-completed-material-example/lesson2-completed-material-example.component.css: -------------------------------------------------------------------------------- 1 | mat-form-field { 2 | width: 400px; 3 | } 4 | -------------------------------------------------------------------------------- /libs/section2/src/lib/lesson2/completed/lesson2-completed-material-example/lesson2-completed-material-example.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | 4 | Some Less Than 10-Character Input 5 | 6 | 7 | Some input is required. 8 | 9 | 10 | Input must be less than {{ maxlength.requiredLength }} characters. 11 | 12 | 13 |
14 | 22 |
23 | -------------------------------------------------------------------------------- /libs/section2/src/lib/lesson2/completed/lesson2-completed-material-example/lesson2-completed-material-example.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | import { FormControl, FormGroup, Validators } from '@angular/forms'; 3 | 4 | @Component({ 5 | selector: 'forms-course-lesson2-completed-material-example', 6 | templateUrl: './lesson2-completed-material-example.component.html', 7 | styleUrls: ['./lesson2-completed-material-example.component.css'] 8 | }) 9 | export class Lesson2CompletedMaterialExampleComponent { 10 | form = new FormGroup({ 11 | input: new FormControl('', [Validators.required, Validators.maxLength(10)]) 12 | }); 13 | 14 | submit() { 15 | alert('Submitted!'); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /libs/section2/src/lib/lesson2/lesson2-shell/lesson2-shell.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nrwl/angular-reactive-forms-course/40af5ad1af54c453625f747e1ae20dc184ef10fd/libs/section2/src/lib/lesson2/lesson2-shell/lesson2-shell.component.css -------------------------------------------------------------------------------- /libs/section2/src/lib/lesson2/lesson2-shell/lesson2-shell.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { Lesson2ShellComponent } from './lesson2-shell.component'; 4 | 5 | describe('Lesson2ShellComponent', () => { 6 | let component: Lesson2ShellComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ Lesson2ShellComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(Lesson2ShellComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /libs/section2/src/lib/lesson2/material-example/material-example.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nrwl/angular-reactive-forms-course/40af5ad1af54c453625f747e1ae20dc184ef10fd/libs/section2/src/lib/lesson2/material-example/material-example.component.css -------------------------------------------------------------------------------- /libs/section2/src/lib/lesson2/material-example/material-example.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | 4 | 5 |
6 |
7 | Some input is required. 8 |
9 |
10 | Input must be less than [[ max allowed length]] characters. 11 |
12 |
13 |
14 | 17 |
18 | -------------------------------------------------------------------------------- /libs/section2/src/lib/lesson2/material-example/material-example.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { MaterialExampleComponent } from './material-example.component'; 4 | 5 | describe('MaterialExampleComponent', () => { 6 | let component: MaterialExampleComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ MaterialExampleComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(MaterialExampleComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /libs/section2/src/lib/lesson2/material-example/material-example.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | import { FormControl, FormGroup, Validators } from '@angular/forms'; 3 | 4 | @Component({ 5 | selector: 'forms-course-material-example', 6 | templateUrl: './material-example.component.html', 7 | styleUrls: ['./material-example.component.css'] 8 | }) 9 | export class MaterialExampleComponent { 10 | form = new FormGroup({ 11 | input: new FormControl('', [Validators.required, Validators.maxLength(10)]) 12 | }); 13 | 14 | submit() { 15 | alert('Submitted!'); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /libs/section2/src/lib/lesson3/completed/lesson3-completed-hero-validation/lesson3-completed-hero-validation.component.css: -------------------------------------------------------------------------------- 1 | .stat-card { 2 | width: 400px; 3 | } 4 | 5 | .stat-card.total-stats-error { 6 | border-color: red; 7 | border-width: 3px; 8 | border-style: solid; 9 | } 10 | 11 | mat-form-field { 12 | width: 100%; 13 | } 14 | -------------------------------------------------------------------------------- /libs/section2/src/lib/lesson3/completed/lesson3-completed-hero-validation/lesson3-completed-hero-validation.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { Lesson3CompletedHeroValidationComponent } from './lesson3-completed-hero-validation.component'; 4 | 5 | describe('Lesson3CompletedHeroValidationComponent', () => { 6 | let component: Lesson3CompletedHeroValidationComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ Lesson3CompletedHeroValidationComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(Lesson3CompletedHeroValidationComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /libs/section2/src/lib/lesson3/hero-validation/hero-validation.component.css: -------------------------------------------------------------------------------- 1 | .stat-card { 2 | width: 400px; 3 | } 4 | 5 | .stat-card.total-stats-error { 6 | border-color: red; 7 | border-width: 3px; 8 | border-style: solid; 9 | } 10 | 11 | mat-form-field { 12 | width: 100%; 13 | } 14 | -------------------------------------------------------------------------------- /libs/section2/src/lib/lesson3/hero-validation/hero-validation.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { HeroValidationComponent } from './hero-validation.component'; 4 | 5 | describe('HeroValidationComponent', () => { 6 | let component: HeroValidationComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ HeroValidationComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(HeroValidationComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /libs/section2/src/lib/lesson3/hero-validation/hero-validation.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | import { 3 | FormControl, 4 | FormGroup, 5 | ValidatorFn, 6 | Validators 7 | } from '@angular/forms'; 8 | 9 | const stats = ['attack', 'defense', 'speed', 'health']; 10 | 11 | const MIN_SINGLE_STAT = 0; 12 | const MAX_SINGLE_STAT = 20; 13 | const MAX_TOTAL_STATS = 60; 14 | 15 | const singleStatValidators = [ 16 | Validators.required, 17 | Validators.min(MIN_SINGLE_STAT), 18 | Validators.max(MAX_SINGLE_STAT) 19 | ]; 20 | 21 | const heroValidator: ValidatorFn = (control: FormGroup) => { 22 | // define the validator here!! 23 | return null; 24 | }; 25 | 26 | const createSingleStatControl = () => new FormControl(0, singleStatValidators); 27 | 28 | @Component({ 29 | selector: 'forms-course-hero-validation-2', 30 | templateUrl: './hero-validation.component.html', 31 | styleUrls: ['./hero-validation.component.css'] 32 | }) 33 | export class HeroValidationComponent {} 34 | -------------------------------------------------------------------------------- /libs/section2/src/lib/lesson3/lesson3-shell/lesson3-shell.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nrwl/angular-reactive-forms-course/40af5ad1af54c453625f747e1ae20dc184ef10fd/libs/section2/src/lib/lesson3/lesson3-shell/lesson3-shell.component.css -------------------------------------------------------------------------------- /libs/section2/src/lib/lesson3/lesson3-shell/lesson3-shell.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { Lesson3ShellComponent } from './lesson3-shell.component'; 4 | 5 | describe('Lesson3ShellComponent', () => { 6 | let component: Lesson3ShellComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ Lesson3ShellComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(Lesson3ShellComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /libs/section2/src/lib/lesson4/completed/lesson4-completed-full-name/lesson4-completed-full-name.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nrwl/angular-reactive-forms-course/40af5ad1af54c453625f747e1ae20dc184ef10fd/libs/section2/src/lib/lesson4/completed/lesson4-completed-full-name/lesson4-completed-full-name.component.css -------------------------------------------------------------------------------- /libs/section2/src/lib/lesson4/completed/lesson4-completed-full-name/lesson4-completed-full-name.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { Lesson4CompletedFullNameComponent } from './lesson4-completed-full-name.component'; 4 | 5 | describe('Lesson4CompletedFullNameComponent', () => { 6 | let component: Lesson4CompletedFullNameComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ Lesson4CompletedFullNameComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(Lesson4CompletedFullNameComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /libs/section2/src/lib/lesson4/completed/lesson4-completed-hero-adder/lesson4-completed-hero-adder.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nrwl/angular-reactive-forms-course/40af5ad1af54c453625f747e1ae20dc184ef10fd/libs/section2/src/lib/lesson4/completed/lesson4-completed-hero-adder/lesson4-completed-hero-adder.component.css -------------------------------------------------------------------------------- /libs/section2/src/lib/lesson4/completed/lesson4-completed-hero-adder/lesson4-completed-hero-adder.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | 4 | Hero Name 5 | 6 | 7 | Name is Required 8 | 9 | 10 | Max Name Length is 16. 11 | 12 | 13 | Name Already Exists 14 | 15 | 16 |
17 | 18 | 26 |
27 | -------------------------------------------------------------------------------- /libs/section2/src/lib/lesson4/completed/lesson4-completed-hero-adder/lesson4-completed-hero-adder.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { Lesson4CompletedHeroAdderComponent } from './lesson4-completed-hero-adder.component'; 4 | 5 | describe('Lesson4CompletedHeroAdderComponent', () => { 6 | let component: Lesson4CompletedHeroAdderComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ Lesson4CompletedHeroAdderComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(Lesson4CompletedHeroAdderComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /libs/section2/src/lib/lesson4/full-name/full-name.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nrwl/angular-reactive-forms-course/40af5ad1af54c453625f747e1ae20dc184ef10fd/libs/section2/src/lib/lesson4/full-name/full-name.component.css -------------------------------------------------------------------------------- /libs/section2/src/lib/lesson4/full-name/full-name.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { FullNameComponent } from './full-name.component'; 4 | 5 | describe('FullNameComponent', () => { 6 | let component: FullNameComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ FullNameComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(FullNameComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /libs/section2/src/lib/lesson4/hero-adder/hero-adder.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nrwl/angular-reactive-forms-course/40af5ad1af54c453625f747e1ae20dc184ef10fd/libs/section2/src/lib/lesson4/hero-adder/hero-adder.component.css -------------------------------------------------------------------------------- /libs/section2/src/lib/lesson4/hero-adder/hero-adder.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | 4 | Hero Name 5 | 6 | 7 | Name is Required 8 | 9 | 10 | Max Name Length is 16. 11 | 12 | 13 | Name Already Exists 14 | 15 | 16 |
17 | 18 | 26 |
27 | -------------------------------------------------------------------------------- /libs/section2/src/lib/lesson4/hero-adder/hero-adder.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { HeroAdderComponent } from './hero-adder.component'; 4 | 5 | describe('HeroAdderComponent', () => { 6 | let component: HeroAdderComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ HeroAdderComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(HeroAdderComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /libs/section2/src/lib/lesson4/lesson4-shell/lesson4-shell.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nrwl/angular-reactive-forms-course/40af5ad1af54c453625f747e1ae20dc184ef10fd/libs/section2/src/lib/lesson4/lesson4-shell/lesson4-shell.component.css -------------------------------------------------------------------------------- /libs/section2/src/lib/lesson4/lesson4-shell/lesson4-shell.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { Lesson4ShellComponent } from './lesson4-shell.component'; 4 | 5 | describe('Lesson4ShellComponent', () => { 6 | let component: Lesson4ShellComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ Lesson4ShellComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(Lesson4ShellComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /libs/section2/src/lib/lesson5/lesson5-shell/lesson5-shell.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nrwl/angular-reactive-forms-course/40af5ad1af54c453625f747e1ae20dc184ef10fd/libs/section2/src/lib/lesson5/lesson5-shell/lesson5-shell.component.css -------------------------------------------------------------------------------- /libs/section2/src/lib/lesson5/lesson5-shell/lesson5-shell.component.html: -------------------------------------------------------------------------------- 1 |

2 | lesson5-shell works! 3 |

4 | -------------------------------------------------------------------------------- /libs/section2/src/lib/lesson5/lesson5-shell/lesson5-shell.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { Lesson5ShellComponent } from './lesson5-shell.component'; 4 | 5 | describe('Lesson5ShellComponent', () => { 6 | let component: Lesson5ShellComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ Lesson5ShellComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(Lesson5ShellComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /libs/section2/src/lib/lesson5/lesson5-shell/lesson5-shell.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'forms-course-lesson5-shell', 5 | templateUrl: './lesson5-shell.component.html', 6 | styleUrls: ['./lesson5-shell.component.css'] 7 | }) 8 | export class Lesson5ShellComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /libs/section2/src/lib/section2.module.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, TestBed } from '@angular/core/testing'; 2 | import { Section2Module } from './section2.module'; 3 | 4 | describe('Section2Module', () => { 5 | beforeEach(async(() => { 6 | TestBed.configureTestingModule({ 7 | imports: [Section2Module] 8 | }).compileComponents(); 9 | })); 10 | 11 | it('should create', () => { 12 | expect(Section2Module).toBeDefined(); 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /libs/section2/src/test-setup.ts: -------------------------------------------------------------------------------- 1 | import 'jest-preset-angular'; 2 | -------------------------------------------------------------------------------- /libs/section2/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "types": ["node", "jest"] 5 | }, 6 | "include": ["**/*.ts"] 7 | } 8 | -------------------------------------------------------------------------------- /libs/section2/tsconfig.lib.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../dist/out-tsc", 5 | "target": "es2015", 6 | "declaration": true, 7 | "inlineSources": true, 8 | "types": [], 9 | "lib": ["dom", "es2018"] 10 | }, 11 | "angularCompilerOptions": { 12 | "annotateForClosureCompiler": true, 13 | "skipTemplateCodegen": true, 14 | "strictMetadataEmit": true, 15 | "fullTemplateTypeCheck": true, 16 | "strictInjectionParameters": true, 17 | "enableResourceInlining": true 18 | }, 19 | "exclude": ["src/test.ts", "**/*.spec.ts"] 20 | } 21 | -------------------------------------------------------------------------------- /libs/section2/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../dist/out-tsc", 5 | "module": "commonjs", 6 | "types": ["jest", "node"] 7 | }, 8 | "files": ["src/test-setup.ts"], 9 | "include": ["**/*.spec.ts", "**/*.d.ts"] 10 | } 11 | -------------------------------------------------------------------------------- /libs/section2/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tslint.json", 3 | "rules": { 4 | "directive-selector": [true, "attribute", "formsCourse", "camelCase"], 5 | "component-selector": [true, "element", "forms-course", "kebab-case"] 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /libs/section3/README.md: -------------------------------------------------------------------------------- 1 | # section3 2 | 3 | This library was generated with [Nx](https://nx.dev). 4 | 5 | ## Running unit tests 6 | 7 | Run `ng test section3` to execute the unit tests. 8 | -------------------------------------------------------------------------------- /libs/section3/jest.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | name: 'section3', 3 | preset: '../../jest.config.js', 4 | coverageDirectory: '../../coverage/libs/section3', 5 | snapshotSerializers: [ 6 | 'jest-preset-angular/AngularSnapshotSerializer.js', 7 | 'jest-preset-angular/HTMLCommentSerializer.js' 8 | ] 9 | }; 10 | -------------------------------------------------------------------------------- /libs/section3/src/index.ts: -------------------------------------------------------------------------------- 1 | export * from './lib/section3.module'; 2 | -------------------------------------------------------------------------------- /libs/section3/src/lib/lesson1/completed/lesson1-completed-number-picker/lesson1-completed-number-picker.component.css: -------------------------------------------------------------------------------- 1 | span { 2 | margin: 20px; 3 | } 4 | -------------------------------------------------------------------------------- /libs/section3/src/lib/lesson1/completed/lesson1-completed-number-picker/lesson1-completed-number-picker.component.html: -------------------------------------------------------------------------------- 1 |
2 | 5 | {{ value }} 6 | 9 |
10 | -------------------------------------------------------------------------------- /libs/section3/src/lib/lesson1/completed/lesson1-completed-number-picker/lesson1-completed-number-picker.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { Lesson1CompletedNumberPickerComponent } from './lesson1-completed-number-picker.component'; 4 | 5 | describe('Lesson1CompletedNumberPickerComponent', () => { 6 | let component: Lesson1CompletedNumberPickerComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ Lesson1CompletedNumberPickerComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(Lesson1CompletedNumberPickerComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /libs/section3/src/lib/lesson1/completed/lesson1-completed-toggle-form/lesson1-completed-toggle-form.component.html: -------------------------------------------------------------------------------- 1 | 5 | -------------------------------------------------------------------------------- /libs/section3/src/lib/lesson1/completed/lesson1-completed-toggle-form/lesson1-completed-toggle-form.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { Lesson1CompletedToggleFormComponent } from './lesson1-completed-toggle-form.component'; 4 | 5 | describe('Lesson1CompletedToggleFormComponent', () => { 6 | let component: Lesson1CompletedToggleFormComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ Lesson1CompletedToggleFormComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(Lesson1CompletedToggleFormComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /libs/section3/src/lib/lesson1/lesson1-shell/lesson1-shell.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nrwl/angular-reactive-forms-course/40af5ad1af54c453625f747e1ae20dc184ef10fd/libs/section3/src/lib/lesson1/lesson1-shell/lesson1-shell.component.css -------------------------------------------------------------------------------- /libs/section3/src/lib/lesson1/lesson1-shell/lesson1-shell.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { Lesson1ShellComponent } from './lesson1-shell.component'; 4 | 5 | describe('Lesson1ShellComponent', () => { 6 | let component: Lesson1ShellComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ Lesson1ShellComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(Lesson1ShellComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /libs/section3/src/lib/lesson1/number-picker/number-picker.component.css: -------------------------------------------------------------------------------- 1 | span { 2 | margin: 20px; 3 | } 4 | -------------------------------------------------------------------------------- /libs/section3/src/lib/lesson1/number-picker/number-picker.component.html: -------------------------------------------------------------------------------- 1 |
2 | 5 | {{ value }} 6 | 9 |
10 | -------------------------------------------------------------------------------- /libs/section3/src/lib/lesson1/number-picker/number-picker.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { NumberPickerComponent } from './number-picker.component'; 4 | 5 | describe('NumberPickerComponent', () => { 6 | let component: NumberPickerComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ NumberPickerComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(NumberPickerComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /libs/section3/src/lib/lesson1/toggle-form/toggle-form.component.html: -------------------------------------------------------------------------------- 1 | 5 | -------------------------------------------------------------------------------- /libs/section3/src/lib/lesson1/toggle-form/toggle-form.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { ToggleFormComponent } from './toggle-form.component'; 4 | 5 | describe('ToggleFormComponent', () => { 6 | let component: ToggleFormComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ ToggleFormComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(ToggleFormComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /libs/section3/src/lib/lesson2/completed/lesson2-completed-date-time-picker/lesson2-completed-date-time-picker.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nrwl/angular-reactive-forms-course/40af5ad1af54c453625f747e1ae20dc184ef10fd/libs/section3/src/lib/lesson2/completed/lesson2-completed-date-time-picker/lesson2-completed-date-time-picker.component.css -------------------------------------------------------------------------------- /libs/section3/src/lib/lesson2/completed/lesson2-completed-date-time-picker/lesson2-completed-date-time-picker.component.html: -------------------------------------------------------------------------------- 1 |
2 | 3 | 4 |
5 | -------------------------------------------------------------------------------- /libs/section3/src/lib/lesson2/completed/lesson2-completed-date-time-picker/lesson2-completed-date-time-picker.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { Lesson2CompletedDateTimePickerComponent } from './lesson2-completed-date-time-picker.component'; 4 | 5 | describe('Lesson2CompletedDateTimePickerComponent', () => { 6 | let component: Lesson2CompletedDateTimePickerComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ Lesson2CompletedDateTimePickerComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(Lesson2CompletedDateTimePickerComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /libs/section3/src/lib/lesson2/date-time-picker/date-time-picker.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nrwl/angular-reactive-forms-course/40af5ad1af54c453625f747e1ae20dc184ef10fd/libs/section3/src/lib/lesson2/date-time-picker/date-time-picker.component.css -------------------------------------------------------------------------------- /libs/section3/src/lib/lesson2/date-time-picker/date-time-picker.component.html: -------------------------------------------------------------------------------- 1 |
2 | 3 | 4 |
5 | -------------------------------------------------------------------------------- /libs/section3/src/lib/lesson2/date-time-picker/date-time-picker.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { DateTimePickerComponent } from './date-time-picker.component'; 4 | 5 | describe('DateTimePickerComponent', () => { 6 | let component: DateTimePickerComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ DateTimePickerComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(DateTimePickerComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /libs/section3/src/lib/lesson2/lesson2-shell/lesson2-shell.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nrwl/angular-reactive-forms-course/40af5ad1af54c453625f747e1ae20dc184ef10fd/libs/section3/src/lib/lesson2/lesson2-shell/lesson2-shell.component.css -------------------------------------------------------------------------------- /libs/section3/src/lib/lesson2/lesson2-shell/lesson2-shell.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { Lesson2ShellComponent } from './lesson2-shell.component'; 4 | 5 | describe('Lesson2ShellComponent', () => { 6 | let component: Lesson2ShellComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ Lesson2ShellComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(Lesson2ShellComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /libs/section3/src/lib/lesson3/completed/lesson3-completed-hero-form/lesson3-completed-hero-form.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nrwl/angular-reactive-forms-course/40af5ad1af54c453625f747e1ae20dc184ef10fd/libs/section3/src/lib/lesson3/completed/lesson3-completed-hero-form/lesson3-completed-hero-form.component.css -------------------------------------------------------------------------------- /libs/section3/src/lib/lesson3/completed/lesson3-completed-hero-form/lesson3-completed-hero-form.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { Lesson3CompletedHeroFormComponent } from './lesson3-completed-hero-form.component'; 4 | 5 | describe('Lesson3CompletedHeroFormComponent', () => { 6 | let component: Lesson3CompletedHeroFormComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ Lesson3CompletedHeroFormComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(Lesson3CompletedHeroFormComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /libs/section3/src/lib/lesson3/hero-form/hero-form.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nrwl/angular-reactive-forms-course/40af5ad1af54c453625f747e1ae20dc184ef10fd/libs/section3/src/lib/lesson3/hero-form/hero-form.component.css -------------------------------------------------------------------------------- /libs/section3/src/lib/lesson3/hero-form/hero-form.component.html: -------------------------------------------------------------------------------- 1 |
2 | 3 | 4 | Hero Form 5 | 6 | 7 | 8 | Hero Name 9 | 10 | 11 | 12 | 13 | 14 | 15 | Hero Stats 16 | 17 | 18 |
19 | 20 | {{ statName | titlecase }} 21 | 22 | 23 |
24 |
25 | 26 |
27 |
28 | 29 | -------------------------------------------------------------------------------- /libs/section3/src/lib/lesson3/hero-form/hero-form.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { HeroFormComponent } from './hero-form.component'; 4 | 5 | describe('HeroFormComponent', () => { 6 | let component: HeroFormComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ HeroFormComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(HeroFormComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /libs/section3/src/lib/lesson3/lesson3-shell/lesson3-shell.component.css: -------------------------------------------------------------------------------- 1 | ::ng-deep .stat-card { 2 | margin: 0px; 3 | } 4 | -------------------------------------------------------------------------------- /libs/section3/src/lib/lesson3/lesson3-shell/lesson3-shell.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { Lesson3ShellComponent } from './lesson3-shell.component'; 4 | 5 | describe('Lesson3ShellComponent', () => { 6 | let component: Lesson3ShellComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ Lesson3ShellComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(Lesson3ShellComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /libs/section3/src/lib/section3.module.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, TestBed } from '@angular/core/testing'; 2 | import { Section3Module } from './section3.module'; 3 | 4 | describe('Section3Module', () => { 5 | beforeEach(async(() => { 6 | TestBed.configureTestingModule({ 7 | imports: [Section3Module] 8 | }).compileComponents(); 9 | })); 10 | 11 | it('should create', () => { 12 | expect(Section3Module).toBeDefined(); 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /libs/section3/src/test-setup.ts: -------------------------------------------------------------------------------- 1 | import 'jest-preset-angular'; 2 | -------------------------------------------------------------------------------- /libs/section3/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "types": ["node", "jest"] 5 | }, 6 | "include": ["**/*.ts"] 7 | } 8 | -------------------------------------------------------------------------------- /libs/section3/tsconfig.lib.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../dist/out-tsc", 5 | "target": "es2015", 6 | "declaration": true, 7 | "inlineSources": true, 8 | "types": [], 9 | "lib": ["dom", "es2018"] 10 | }, 11 | "angularCompilerOptions": { 12 | "annotateForClosureCompiler": true, 13 | "skipTemplateCodegen": true, 14 | "strictMetadataEmit": true, 15 | "fullTemplateTypeCheck": true, 16 | "strictInjectionParameters": true, 17 | "enableResourceInlining": true 18 | }, 19 | "exclude": ["src/test.ts", "**/*.spec.ts"] 20 | } 21 | -------------------------------------------------------------------------------- /libs/section3/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../dist/out-tsc", 5 | "module": "commonjs", 6 | "types": ["jest", "node"] 7 | }, 8 | "files": ["src/test-setup.ts"], 9 | "include": ["**/*.spec.ts", "**/*.d.ts"] 10 | } 11 | -------------------------------------------------------------------------------- /libs/section3/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tslint.json", 3 | "rules": { 4 | "directive-selector": [true, "attribute", "formsCourse", "camelCase"], 5 | "component-selector": [true, "element", "forms-course", "kebab-case"] 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /libs/section4/README.md: -------------------------------------------------------------------------------- 1 | # section4 2 | 3 | This library was generated with [Nx](https://nx.dev). 4 | 5 | ## Running unit tests 6 | 7 | Run `ng test section4` to execute the unit tests. 8 | -------------------------------------------------------------------------------- /libs/section4/jest.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | name: 'section4', 3 | preset: '../../jest.config.js', 4 | coverageDirectory: '../../coverage/libs/section4', 5 | snapshotSerializers: [ 6 | 'jest-preset-angular/AngularSnapshotSerializer.js', 7 | 'jest-preset-angular/HTMLCommentSerializer.js' 8 | ] 9 | }; 10 | -------------------------------------------------------------------------------- /libs/section4/src/index.ts: -------------------------------------------------------------------------------- 1 | export * from './lib/section4.module'; 2 | -------------------------------------------------------------------------------- /libs/section4/src/lib/date-time-picker/date-time-picker.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nrwl/angular-reactive-forms-course/40af5ad1af54c453625f747e1ae20dc184ef10fd/libs/section4/src/lib/date-time-picker/date-time-picker.component.css -------------------------------------------------------------------------------- /libs/section4/src/lib/date-time-picker/date-time-picker.component.html: -------------------------------------------------------------------------------- 1 |
2 | 3 | 4 |
5 | -------------------------------------------------------------------------------- /libs/section4/src/lib/date-time-picker/date-time-picker.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { DateTimePickerComponent } from './date-time-picker.component'; 4 | 5 | describe('DateTimePickerComponent', () => { 6 | let component: DateTimePickerComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ DateTimePickerComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(DateTimePickerComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /libs/section4/src/lib/hero-form/hero-form.component.css: -------------------------------------------------------------------------------- 1 | mat-card.stat-card { 2 | margin: 10px; 3 | } 4 | 5 | .hero-card { 6 | margin: 10px; 7 | } 8 | 9 | mat-card.stat-card mat-form-field { 10 | max-width: 100px; 11 | margin-left: 10px; 12 | margin-bottom: 40px; 13 | } 14 | 15 | .stat-card mat-card-content { 16 | display: grid; 17 | grid-template-columns: repeat(2, 1fr); 18 | grid-template-rows: repeat(2, 1fr); 19 | } 20 | 21 | .stat-card.total-stats-error mat-card-content { 22 | grid-template-rows: repeat(3, 0.2fr); 23 | } 24 | 25 | .hero-card mat-card-content { 26 | display: grid; 27 | place-content: center; 28 | } 29 | 30 | .total-stat-error { 31 | grid-area: 3 / 1 / 4 / 3; 32 | font-size: 12px; 33 | display: grid; 34 | place-content: center; 35 | } 36 | 37 | .total-stat-error div { 38 | text-align: center; 39 | } 40 | 41 | .stat-card.total-stats-error { 42 | border-color: red; 43 | border-width: 3px; 44 | border-style: solid; 45 | } 46 | -------------------------------------------------------------------------------- /libs/section4/src/lib/hero-form/hero-form.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { HeroFormComponent } from './hero-form.component'; 4 | 5 | describe('HeroFormComponent', () => { 6 | let component: HeroFormComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ HeroFormComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(HeroFormComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /libs/section4/src/lib/lesson1/completed/lesson1-completed-date-time-range-picker/lesson1-completed-date-time-range-picker.component.css: -------------------------------------------------------------------------------- 1 | form { 2 | border-style: solid; 3 | border-width: 4px; 4 | border-radius: 10px; 5 | border-color: black; 6 | padding: 10px; 7 | } 8 | 9 | form.error { 10 | border-color: red; 11 | } 12 | 13 | .error-message { 14 | margin-top: 10px; 15 | border-style: solid; 16 | border-width: 2px; 17 | border-radius: 10px; 18 | border-color: red; 19 | padding: 5px; 20 | background-color: rgba(255, 0, 0, 0.3); 21 | } 22 | -------------------------------------------------------------------------------- /libs/section4/src/lib/lesson1/completed/lesson1-completed-date-time-range-picker/lesson1-completed-date-time-range-picker.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | Start Date 4 | 7 |
8 | 9 |
10 | End Date 11 | 14 |
15 | 16 |
17 |

18 | Uh-oh! It looks like your end date occurs before your start date! 19 |

20 |
21 |
22 | -------------------------------------------------------------------------------- /libs/section4/src/lib/lesson1/date-range-picker-form/date-range-picker-form.component.css: -------------------------------------------------------------------------------- 1 | form { 2 | border-style: solid; 3 | border-width: 4px; 4 | border-radius: 10px; 5 | border-color: black; 6 | padding: 10px; 7 | } 8 | 9 | form.error { 10 | border-color: red; 11 | } 12 | 13 | .error-message { 14 | margin-top: 10px; 15 | border-style: solid; 16 | border-width: 2px; 17 | border-radius: 10px; 18 | border-color: red; 19 | padding: 5px; 20 | background-color: rgba(255, 0, 0, 0.3); 21 | } 22 | -------------------------------------------------------------------------------- /libs/section4/src/lib/lesson1/date-range-picker-form/date-range-picker-form.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | Start Date 4 | 5 |
6 | 7 |
8 | End Date 9 | 10 |
11 | 12 |
13 |

14 | Uh-oh! It looks like your end date occurs before your start date! 15 |

16 |
17 |
18 | -------------------------------------------------------------------------------- /libs/section4/src/lib/lesson1/date-range-picker-form/date-range-picker-form.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { DateRangePickerFormComponent } from './date-range-picker-form.component'; 4 | 5 | describe('DateRangePickerFormComponent', () => { 6 | let component: DateRangePickerFormComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ DateRangePickerFormComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(DateRangePickerFormComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /libs/section4/src/lib/lesson1/lesson1-shell/lesson1-shell.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nrwl/angular-reactive-forms-course/40af5ad1af54c453625f747e1ae20dc184ef10fd/libs/section4/src/lib/lesson1/lesson1-shell/lesson1-shell.component.css -------------------------------------------------------------------------------- /libs/section4/src/lib/lesson1/lesson1-shell/lesson1-shell.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { Lesson1ShellComponent } from './lesson1-shell.component'; 4 | 5 | describe('Lesson1ShellComponent', () => { 6 | let component: Lesson1ShellComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ Lesson1ShellComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(Lesson1ShellComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /libs/section4/src/lib/lesson2/completed/lesson2-completed-hero-party-form/lesson2-completed-hero-party-form.component.css: -------------------------------------------------------------------------------- 1 | mat-card { 2 | margin: 10px; 3 | } 4 | 5 | mat-card-content div { 6 | display: grid; 7 | place-content: center; 8 | } 9 | 10 | legend { 11 | background-color: #000; 12 | color: #fff; 13 | padding: 3px 6px; 14 | text-align: center; 15 | } 16 | 17 | fieldset { 18 | border-width: 3px; 19 | border-style: solid; 20 | border-radius: 5px; 21 | margin: 10px; 22 | padding: 10px; 23 | } 24 | 25 | label { 26 | width: 200px; 27 | } 28 | 29 | .hero-container { 30 | display: grid; 31 | grid-template-columns: repeat(2, 1fr); 32 | } 33 | -------------------------------------------------------------------------------- /libs/section4/src/lib/lesson2/completed/lesson2-completed-hero-party-form/lesson2-completed-hero-party-form.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { Lesson2CompletedHeroPartyFormComponent } from './lesson2-completed-hero-party-form.component'; 4 | 5 | describe('Lesson2CompletedHeroPartyFormComponent', () => { 6 | let component: Lesson2CompletedHeroPartyFormComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ Lesson2CompletedHeroPartyFormComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(Lesson2CompletedHeroPartyFormComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /libs/section4/src/lib/lesson2/hero-party-form/hero-party-form.component.css: -------------------------------------------------------------------------------- 1 | mat-card { 2 | margin: 10px; 3 | } 4 | 5 | mat-card-content div { 6 | display: grid; 7 | place-content: center; 8 | } 9 | 10 | legend { 11 | background-color: #000; 12 | color: #fff; 13 | padding: 3px 6px; 14 | text-align: center; 15 | } 16 | 17 | fieldset { 18 | border-width: 3px; 19 | border-style: solid; 20 | border-radius: 5px; 21 | margin: 10px; 22 | padding: 10px; 23 | } 24 | 25 | label { 26 | width: 200px; 27 | } 28 | 29 | .hero-container { 30 | display: grid; 31 | grid-template-columns: repeat(2, 1fr); 32 | } 33 | -------------------------------------------------------------------------------- /libs/section4/src/lib/lesson2/hero-party-form/hero-party-form.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { HeroPartyFormComponent } from './hero-party-form.component'; 4 | 5 | describe('HeroPartyFormComponent', () => { 6 | let component: HeroPartyFormComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ HeroPartyFormComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(HeroPartyFormComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /libs/section4/src/lib/lesson2/lesson2-shell/lesson2-shell.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nrwl/angular-reactive-forms-course/40af5ad1af54c453625f747e1ae20dc184ef10fd/libs/section4/src/lib/lesson2/lesson2-shell/lesson2-shell.component.css -------------------------------------------------------------------------------- /libs/section4/src/lib/lesson2/lesson2-shell/lesson2-shell.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { Lesson2ShellComponent } from './lesson2-shell.component'; 4 | 5 | describe('Lesson2ShellComponent', () => { 6 | let component: Lesson2ShellComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ Lesson2ShellComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(Lesson2ShellComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /libs/section4/src/lib/lesson3/completed/lesson3-completed-family-tree-form/lesson3-completed-family-tree-form.component.css: -------------------------------------------------------------------------------- 1 | fieldset { 2 | border-width: 2px; 3 | border-style: solid; 4 | } 5 | 6 | label { 7 | display: block; 8 | } 9 | 10 | .add-child { 11 | display: block; 12 | } 13 | 14 | .remove-child { 15 | float: right; 16 | } 17 | 18 | .child { 19 | display: grid; 20 | grid-template-columns: 4fr 1fr; 21 | } 22 | -------------------------------------------------------------------------------- /libs/section4/src/lib/lesson3/completed/lesson3-completed-family-tree-form/lesson3-completed-family-tree-form.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { Lesson3CompletedFamilyTreeFormComponent } from './lesson3-completed-family-tree-form.component'; 4 | 5 | describe('Lesson3CompletedFamilyTreeFormComponent', () => { 6 | let component: Lesson3CompletedFamilyTreeFormComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ Lesson3CompletedFamilyTreeFormComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(Lesson3CompletedFamilyTreeFormComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /libs/section4/src/lib/lesson3/family-tree-form/family-tree-form.component.css: -------------------------------------------------------------------------------- 1 | fieldset { 2 | border-width: 2px; 3 | border-style: solid; 4 | } 5 | 6 | label { 7 | display: block; 8 | } 9 | 10 | .add-child { 11 | display: block; 12 | } 13 | 14 | .remove-child { 15 | float: right; 16 | } 17 | 18 | .child { 19 | display: grid; 20 | grid-template-columns: 4fr 1fr; 21 | } 22 | -------------------------------------------------------------------------------- /libs/section4/src/lib/lesson3/family-tree-form/family-tree-form.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | 4 | 5 |
6 |
7 | 8 | 9 |
10 |
11 | 12 | 15 |
16 | 17 | 20 |
21 |
22 |
23 | -------------------------------------------------------------------------------- /libs/section4/src/lib/lesson3/family-tree-form/family-tree-form.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { FamilyTreeFormComponent } from './family-tree-form.component'; 4 | 5 | describe('FamilyTreeFormComponent', () => { 6 | let component: FamilyTreeFormComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ FamilyTreeFormComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(FamilyTreeFormComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /libs/section4/src/lib/lesson3/lesson3-shell/lesson3-shell.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nrwl/angular-reactive-forms-course/40af5ad1af54c453625f747e1ae20dc184ef10fd/libs/section4/src/lib/lesson3/lesson3-shell/lesson3-shell.component.css -------------------------------------------------------------------------------- /libs/section4/src/lib/lesson3/lesson3-shell/lesson3-shell.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { Lesson3ShellComponent } from './lesson3-shell.component'; 4 | 5 | describe('Lesson3ShellComponent', () => { 6 | let component: Lesson3ShellComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ Lesson3ShellComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(Lesson3ShellComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /libs/section4/src/lib/lesson4/lesson4-shell/lesson4-shell.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nrwl/angular-reactive-forms-course/40af5ad1af54c453625f747e1ae20dc184ef10fd/libs/section4/src/lib/lesson4/lesson4-shell/lesson4-shell.component.css -------------------------------------------------------------------------------- /libs/section4/src/lib/lesson4/lesson4-shell/lesson4-shell.component.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nrwl/angular-reactive-forms-course/40af5ad1af54c453625f747e1ae20dc184ef10fd/libs/section4/src/lib/lesson4/lesson4-shell/lesson4-shell.component.html -------------------------------------------------------------------------------- /libs/section4/src/lib/lesson4/lesson4-shell/lesson4-shell.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { Lesson4ShellComponent } from './lesson4-shell.component'; 4 | 5 | describe('Lesson4ShellComponent', () => { 6 | let component: Lesson4ShellComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ Lesson4ShellComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(Lesson4ShellComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /libs/section4/src/lib/lesson4/lesson4-shell/lesson4-shell.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'forms-course-lesson4-shell', 5 | templateUrl: './lesson4-shell.component.html', 6 | styleUrls: ['./lesson4-shell.component.css'] 7 | }) 8 | export class Lesson4ShellComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /libs/section4/src/lib/section4.module.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, TestBed } from '@angular/core/testing'; 2 | import { Section4Module } from './section4.module'; 3 | 4 | describe('Section4Module', () => { 5 | beforeEach(async(() => { 6 | TestBed.configureTestingModule({ 7 | imports: [Section4Module] 8 | }).compileComponents(); 9 | })); 10 | 11 | it('should create', () => { 12 | expect(Section4Module).toBeDefined(); 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /libs/section4/src/test-setup.ts: -------------------------------------------------------------------------------- 1 | import 'jest-preset-angular'; 2 | -------------------------------------------------------------------------------- /libs/section4/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "types": ["node", "jest"] 5 | }, 6 | "include": ["**/*.ts"] 7 | } 8 | -------------------------------------------------------------------------------- /libs/section4/tsconfig.lib.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../dist/out-tsc", 5 | "target": "es2015", 6 | "declaration": true, 7 | "inlineSources": true, 8 | "types": [], 9 | "lib": ["dom", "es2018"] 10 | }, 11 | "angularCompilerOptions": { 12 | "annotateForClosureCompiler": true, 13 | "skipTemplateCodegen": true, 14 | "strictMetadataEmit": true, 15 | "fullTemplateTypeCheck": true, 16 | "strictInjectionParameters": true, 17 | "enableResourceInlining": true 18 | }, 19 | "exclude": ["src/test.ts", "**/*.spec.ts"] 20 | } 21 | -------------------------------------------------------------------------------- /libs/section4/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../dist/out-tsc", 5 | "module": "commonjs", 6 | "types": ["jest", "node"] 7 | }, 8 | "files": ["src/test-setup.ts"], 9 | "include": ["**/*.spec.ts", "**/*.d.ts"] 10 | } 11 | -------------------------------------------------------------------------------- /libs/section4/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tslint.json", 3 | "rules": { 4 | "directive-selector": [true, "attribute", "formsCourse", "camelCase"], 5 | "component-selector": [true, "element", "forms-course", "kebab-case"] 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /libs/section5/README.md: -------------------------------------------------------------------------------- 1 | # section5 2 | 3 | This library was generated with [Nx](https://nx.dev). 4 | 5 | ## Running unit tests 6 | 7 | Run `ng test section5` to execute the unit tests. 8 | -------------------------------------------------------------------------------- /libs/section5/jest.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | name: 'section5', 3 | preset: '../../jest.config.js', 4 | coverageDirectory: '../../coverage/libs/section5', 5 | snapshotSerializers: [ 6 | 'jest-preset-angular/AngularSnapshotSerializer.js', 7 | 'jest-preset-angular/HTMLCommentSerializer.js' 8 | ] 9 | }; 10 | -------------------------------------------------------------------------------- /libs/section5/src/index.ts: -------------------------------------------------------------------------------- 1 | export * from './lib/section5.module'; 2 | -------------------------------------------------------------------------------- /libs/section5/src/lib/+state/config-settings/config-settings.actions.ts: -------------------------------------------------------------------------------- 1 | import { createAction, props } from '@ngrx/store'; 2 | import { ConfigSettings } from './config-settings.interfaces'; 3 | 4 | export const submitSaveRequest = createAction( 5 | '[ Config Wizard ]', 6 | props<{ configSettings: ConfigSettings }>() 7 | ); 8 | 9 | export const saveSuccessful = createAction( 10 | '[ Config API ]', 11 | props<{ configSettings: ConfigSettings }>() 12 | ); 13 | -------------------------------------------------------------------------------- /libs/section5/src/lib/+state/config-settings/config-settings.effects.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | import { Actions, createEffect, ofType } from '@ngrx/effects'; 3 | import { submitSaveRequest, saveSuccessful } from './config-settings.actions'; 4 | import { delay, map } from 'rxjs/operators'; 5 | 6 | const DELAY_OFFSET = 4000; 7 | 8 | @Injectable() 9 | export class ConfigSettingsEffects { 10 | submitSave$ = createEffect(() => 11 | this.actions$.pipe( 12 | ofType(submitSaveRequest), 13 | delay(DELAY_OFFSET), 14 | map(({ configSettings }) => saveSuccessful({ configSettings })) 15 | ) 16 | ); 17 | 18 | constructor(private actions$: Actions) {} 19 | } 20 | -------------------------------------------------------------------------------- /libs/section5/src/lib/+state/config-settings/index.ts: -------------------------------------------------------------------------------- 1 | export * from './config-settings.actions'; 2 | export * from './config-settings.effects'; 3 | export * from './config-settings.interfaces'; 4 | export * from './config-settings.reducer'; 5 | export * from './config-settings.selectors'; 6 | -------------------------------------------------------------------------------- /libs/section5/src/lib/+state/index.ts: -------------------------------------------------------------------------------- 1 | export * from './config-settings'; 2 | -------------------------------------------------------------------------------- /libs/section5/src/lib/completed/completed-boolean-config-setting-form/completed-boolean-config-setting-form.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nrwl/angular-reactive-forms-course/40af5ad1af54c453625f747e1ae20dc184ef10fd/libs/section5/src/lib/completed/completed-boolean-config-setting-form/completed-boolean-config-setting-form.component.css -------------------------------------------------------------------------------- /libs/section5/src/lib/completed/completed-boolean-config-setting-form/completed-boolean-config-setting-form.component.html: -------------------------------------------------------------------------------- 1 | {{ name }} 10 | -------------------------------------------------------------------------------- /libs/section5/src/lib/completed/completed-confimation-dialog/completed-confimation-dialog.component.css: -------------------------------------------------------------------------------- 1 | table { 2 | width: 100%; 3 | padding: 25px; 4 | margin-top: 25px; 5 | margin-bottom: 25px; 6 | } 7 | -------------------------------------------------------------------------------- /libs/section5/src/lib/completed/completed-confimation-dialog/completed-confimation-dialog.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { CompletedConfimationDialogComponent } from './completed-confimation-dialog.component'; 4 | 5 | describe('CompletedConfimationDialogComponent', () => { 6 | let component: CompletedConfimationDialogComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ CompletedConfimationDialogComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(CompletedConfimationDialogComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /libs/section5/src/lib/completed/completed-confirm-discard-changes.guard.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed, async, inject } from '@angular/core/testing'; 2 | 3 | import { CompletedConfirmDiscardChangesGuard } from './completed-confirm-discard-changes.guard'; 4 | 5 | describe('CompletedConfirmDiscardChangesGuard', () => { 6 | beforeEach(() => { 7 | TestBed.configureTestingModule({ 8 | providers: [CompletedConfirmDiscardChangesGuard] 9 | }); 10 | }); 11 | 12 | it('should ...', inject([CompletedConfirmDiscardChangesGuard], (guard: CompletedConfirmDiscardChangesGuard) => { 13 | expect(guard).toBeTruthy(); 14 | })); 15 | }); 16 | -------------------------------------------------------------------------------- /libs/section5/src/lib/completed/completed-confirm-discard-changes.guard.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | import { 3 | ActivatedRouteSnapshot, 4 | RouterStateSnapshot, 5 | UrlTree, 6 | CanDeactivate 7 | } from '@angular/router'; 8 | import { Observable } from 'rxjs'; 9 | import { CompletedWizardComponent } from './completed-wizard/completed-wizard.component'; 10 | import { take } from 'rxjs/operators'; 11 | 12 | @Injectable({ 13 | providedIn: 'root' 14 | }) 15 | export class CompletedConfirmDiscardChangesGuard 16 | implements CanDeactivate { 17 | canDeactivate( 18 | component: CompletedWizardComponent, 19 | currentRoute: ActivatedRouteSnapshot, 20 | currentState: RouterStateSnapshot, 21 | nextState?: RouterStateSnapshot 22 | ): Observable { 23 | return component.canDeactivate().pipe(take(1)); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /libs/section5/src/lib/completed/completed-discard-changes-dialog/completed-discard-changes-dialog.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nrwl/angular-reactive-forms-course/40af5ad1af54c453625f747e1ae20dc184ef10fd/libs/section5/src/lib/completed/completed-discard-changes-dialog/completed-discard-changes-dialog.component.css -------------------------------------------------------------------------------- /libs/section5/src/lib/completed/completed-discard-changes-dialog/completed-discard-changes-dialog.component.html: -------------------------------------------------------------------------------- 1 |

Changes Will Be Discarded

2 |
3 |

4 | Your changes will be discarded if you leave this page. 5 |

6 |

7 | Are you sure you want to leave? 8 |

9 |
10 |
11 | 12 | 15 |
16 | -------------------------------------------------------------------------------- /libs/section5/src/lib/completed/completed-discard-changes-dialog/completed-discard-changes-dialog.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { CompletedDiscardChangesDialogComponent } from './completed-discard-changes-dialog.component'; 4 | 5 | describe('CompletedDiscardChangesDialogComponent', () => { 6 | let component: CompletedDiscardChangesDialogComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ CompletedDiscardChangesDialogComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(CompletedDiscardChangesDialogComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /libs/section5/src/lib/completed/completed-discard-changes-dialog/completed-discard-changes-dialog.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | import { MatDialogRef } from '@angular/material/dialog'; 3 | 4 | @Component({ 5 | selector: 'forms-course-completed-discard-changes-dialog', 6 | templateUrl: './completed-discard-changes-dialog.component.html', 7 | styleUrls: ['./completed-discard-changes-dialog.component.css'] 8 | }) 9 | export class CompletedDiscardChangesDialogComponent { 10 | constructor( 11 | private dialogRef: MatDialogRef 12 | ) {} 13 | 14 | leave() { 15 | this.dialogRef.close(true); 16 | } 17 | 18 | cancel() { 19 | this.dialogRef.close(false); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /libs/section5/src/lib/completed/completed-number-config-setting-form/completed-number-config-setting-form.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nrwl/angular-reactive-forms-course/40af5ad1af54c453625f747e1ae20dc184ef10fd/libs/section5/src/lib/completed/completed-number-config-setting-form/completed-number-config-setting-form.component.css -------------------------------------------------------------------------------- /libs/section5/src/lib/completed/completed-number-config-setting-form/completed-number-config-setting-form.component.html: -------------------------------------------------------------------------------- 1 | 7 | {{ name }} 8 | 9 | Required 10 | Minimum value allowed is {{ control['errors'].min.min }} 13 | Maximum value allowed is {{ control['errors'].max.max }} 16 | 17 | -------------------------------------------------------------------------------- /libs/section5/src/lib/completed/completed-string-config-setting-form/completed-string-config-setting-form.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nrwl/angular-reactive-forms-course/40af5ad1af54c453625f747e1ae20dc184ef10fd/libs/section5/src/lib/completed/completed-string-config-setting-form/completed-string-config-setting-form.component.css -------------------------------------------------------------------------------- /libs/section5/src/lib/completed/completed-string-config-setting-form/completed-string-config-setting-form.component.html: -------------------------------------------------------------------------------- 1 | 7 | {{ name }} 8 | 9 | Required 10 | 11 | -------------------------------------------------------------------------------- /libs/section5/src/lib/completed/completed-wizard-form/completed-wizard-form.component.scss: -------------------------------------------------------------------------------- 1 | ::ng-deep .mat-tab-body-content { 2 | display: grid !important; 3 | place-items: center !important; 4 | 5 | forms-course-completed-boolean-config-setting-form, 6 | forms-course-completed-number-config-setting-form, 7 | forms-course-completed-string-config-setting-form { 8 | margin: 20px; 9 | } 10 | } 11 | 12 | ::ng-deep mat-spinner { 13 | margin: 10px; 14 | } 15 | -------------------------------------------------------------------------------- /libs/section5/src/lib/completed/completed-wizard-form/completed-wizard-form.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { CompletedWizardFormComponent } from './completed-wizard-form.component'; 4 | 5 | describe('CompletedWizardFormComponent', () => { 6 | let component: CompletedWizardFormComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ CompletedWizardFormComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(CompletedWizardFormComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /libs/section5/src/lib/completed/completed-wizard/completed-wizard.component.scss: -------------------------------------------------------------------------------- 1 | mat-card { 2 | max-width: 600px; 3 | } 4 | -------------------------------------------------------------------------------- /libs/section5/src/lib/completed/completed-wizard/completed-wizard.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { CompletedWizardComponent } from './completed-wizard.component'; 4 | 5 | describe('CompletedWizardComponent', () => { 6 | let component: CompletedWizardComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ CompletedWizardComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(CompletedWizardComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /libs/section5/src/lib/lesson1/boolean-config-setting-form/boolean-config-setting-form.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nrwl/angular-reactive-forms-course/40af5ad1af54c453625f747e1ae20dc184ef10fd/libs/section5/src/lib/lesson1/boolean-config-setting-form/boolean-config-setting-form.component.css -------------------------------------------------------------------------------- /libs/section5/src/lib/lesson1/boolean-config-setting-form/boolean-config-setting-form.component.html: -------------------------------------------------------------------------------- 1 | 11 | -------------------------------------------------------------------------------- /libs/section5/src/lib/lesson1/boolean-config-setting-form/boolean-config-setting-form.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { BooleanConfigSettingFormComponent } from './boolean-config-setting-form.component'; 4 | 5 | describe('BooleanConfigSettingFormComponent', () => { 6 | let component: BooleanConfigSettingFormComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ BooleanConfigSettingFormComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(BooleanConfigSettingFormComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /libs/section5/src/lib/lesson1/lesson1-shell/lesson1-shell.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nrwl/angular-reactive-forms-course/40af5ad1af54c453625f747e1ae20dc184ef10fd/libs/section5/src/lib/lesson1/lesson1-shell/lesson1-shell.component.css -------------------------------------------------------------------------------- /libs/section5/src/lib/lesson1/lesson1-shell/lesson1-shell.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { Lesson1ShellComponent } from './lesson1-shell.component'; 4 | 5 | describe('Lesson1ShellComponent', () => { 6 | let component: Lesson1ShellComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ Lesson1ShellComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(Lesson1ShellComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /libs/section5/src/lib/lesson1/number-config-setting-form/number-config-setting-form.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nrwl/angular-reactive-forms-course/40af5ad1af54c453625f747e1ae20dc184ef10fd/libs/section5/src/lib/lesson1/number-config-setting-form/number-config-setting-form.component.css -------------------------------------------------------------------------------- /libs/section5/src/lib/lesson1/number-config-setting-form/number-config-setting-form.component.html: -------------------------------------------------------------------------------- 1 | 17 | -------------------------------------------------------------------------------- /libs/section5/src/lib/lesson1/number-config-setting-form/number-config-setting-form.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { NumberConfigSettingFormComponent } from './number-config-setting-form.component'; 4 | 5 | describe('NumberConfigSettingFormComponent', () => { 6 | let component: NumberConfigSettingFormComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ NumberConfigSettingFormComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(NumberConfigSettingFormComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /libs/section5/src/lib/lesson1/string-config-setting-form/string-config-setting-form.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nrwl/angular-reactive-forms-course/40af5ad1af54c453625f747e1ae20dc184ef10fd/libs/section5/src/lib/lesson1/string-config-setting-form/string-config-setting-form.component.css -------------------------------------------------------------------------------- /libs/section5/src/lib/lesson1/string-config-setting-form/string-config-setting-form.component.html: -------------------------------------------------------------------------------- 1 | 11 | -------------------------------------------------------------------------------- /libs/section5/src/lib/lesson1/string-config-setting-form/string-config-setting-form.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { StringConfigSettingFormComponent } from './string-config-setting-form.component'; 4 | 5 | describe('StringConfigSettingFormComponent', () => { 6 | let component: StringConfigSettingFormComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ StringConfigSettingFormComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(StringConfigSettingFormComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /libs/section5/src/lib/lesson2/lesson2-shell/lesson2-shell.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nrwl/angular-reactive-forms-course/40af5ad1af54c453625f747e1ae20dc184ef10fd/libs/section5/src/lib/lesson2/lesson2-shell/lesson2-shell.component.css -------------------------------------------------------------------------------- /libs/section5/src/lib/lesson2/lesson2-shell/lesson2-shell.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { Lesson2ShellComponent } from './lesson2-shell.component'; 4 | 5 | describe('Lesson2ShellComponent', () => { 6 | let component: Lesson2ShellComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ Lesson2ShellComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(Lesson2ShellComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /libs/section5/src/lib/lesson2/wizard-form/wizard-form.component.scss: -------------------------------------------------------------------------------- 1 | ::ng-deep .mat-tab-body-content { 2 | display: grid !important; 3 | place-items: center !important; 4 | 5 | forms-course-completed-boolean-config-setting-form, 6 | forms-course-completed-number-config-setting-form, 7 | forms-course-completed-string-config-setting-form { 8 | margin: 20px; 9 | } 10 | } 11 | 12 | ::ng-deep mat-spinner { 13 | margin: 10px; 14 | } 15 | -------------------------------------------------------------------------------- /libs/section5/src/lib/lesson2/wizard-form/wizard-form.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { WizardFormComponent } from './wizard-form.component'; 4 | 5 | describe('WizardFormComponent', () => { 6 | let component: WizardFormComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ WizardFormComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(WizardFormComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /libs/section5/src/lib/lesson3/lesson3-shell/lesson3-shell.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nrwl/angular-reactive-forms-course/40af5ad1af54c453625f747e1ae20dc184ef10fd/libs/section5/src/lib/lesson3/lesson3-shell/lesson3-shell.component.css -------------------------------------------------------------------------------- /libs/section5/src/lib/lesson3/lesson3-shell/lesson3-shell.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { Lesson3ShellComponent } from './lesson3-shell.component'; 4 | 5 | describe('Lesson3ShellComponent', () => { 6 | let component: Lesson3ShellComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ Lesson3ShellComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(Lesson3ShellComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /libs/section5/src/lib/lesson4/confirm-discard-changes.guard.ts.guard.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed, async, inject } from '@angular/core/testing'; 2 | 3 | import { ConfirmDiscardChanges.Guard.TsGuard } from './confirm-discard-changes.guard.ts.guard'; 4 | 5 | describe('ConfirmDiscardChanges.Guard.TsGuard', () => { 6 | beforeEach(() => { 7 | TestBed.configureTestingModule({ 8 | providers: [ConfirmDiscardChanges.Guard.TsGuard] 9 | }); 10 | }); 11 | 12 | it('should ...', inject([ConfirmDiscardChanges.Guard.TsGuard], (guard: ConfirmDiscardChanges.Guard.TsGuard) => { 13 | expect(guard).toBeTruthy(); 14 | })); 15 | }); 16 | -------------------------------------------------------------------------------- /libs/section5/src/lib/lesson4/confirm-discard-changes.guard.ts.guard.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | import { 3 | ActivatedRouteSnapshot, 4 | RouterStateSnapshot, 5 | UrlTree, 6 | CanDeactivate 7 | } from '@angular/router'; 8 | import { Observable } from 'rxjs'; 9 | import { WizardFormComponent } from '../lesson2/wizard-form/wizard-form.component'; 10 | import { WizardComponent } from '../wizard/wizard.component'; 11 | import { take } from 'rxjs/operators'; 12 | 13 | @Injectable({ 14 | providedIn: 'root' 15 | }) 16 | export class ConfirmDiscardChangesGuard 17 | implements CanDeactivate { 18 | canDeactivate(component: WizardComponent): Observable { 19 | return component.canDeactivate(); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /libs/section5/src/lib/lesson4/lesson4-shell/lesson4-shell.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nrwl/angular-reactive-forms-course/40af5ad1af54c453625f747e1ae20dc184ef10fd/libs/section5/src/lib/lesson4/lesson4-shell/lesson4-shell.component.css -------------------------------------------------------------------------------- /libs/section5/src/lib/lesson4/lesson4-shell/lesson4-shell.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { Lesson4ShellComponent } from './lesson4-shell.component'; 4 | 5 | describe('Lesson4ShellComponent', () => { 6 | let component: Lesson4ShellComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ Lesson4ShellComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(Lesson4ShellComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /libs/section5/src/lib/lesson5/lesson5-shell/lesson5-shell.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nrwl/angular-reactive-forms-course/40af5ad1af54c453625f747e1ae20dc184ef10fd/libs/section5/src/lib/lesson5/lesson5-shell/lesson5-shell.component.css -------------------------------------------------------------------------------- /libs/section5/src/lib/lesson5/lesson5-shell/lesson5-shell.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { Lesson5ShellComponent } from './lesson5-shell.component'; 4 | 5 | describe('Lesson5ShellComponent', () => { 6 | let component: Lesson5ShellComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ Lesson5ShellComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(Lesson5ShellComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /libs/section5/src/lib/section5.module.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, TestBed } from '@angular/core/testing'; 2 | import { Section5Module } from './section5.module'; 3 | 4 | describe('Section5Module', () => { 5 | beforeEach(async(() => { 6 | TestBed.configureTestingModule({ 7 | imports: [Section5Module] 8 | }).compileComponents(); 9 | })); 10 | 11 | it('should create', () => { 12 | expect(Section5Module).toBeDefined(); 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /libs/section5/src/lib/wizard/wizard.component.css: -------------------------------------------------------------------------------- 1 | mat-card { 2 | max-width: 600px; 3 | } 4 | -------------------------------------------------------------------------------- /libs/section5/src/lib/wizard/wizard.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { WizardComponent } from './wizard.component'; 4 | 5 | describe('WizardComponent', () => { 6 | let component: WizardComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ WizardComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(WizardComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /libs/section5/src/test-setup.ts: -------------------------------------------------------------------------------- 1 | import 'jest-preset-angular'; 2 | -------------------------------------------------------------------------------- /libs/section5/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "types": ["node", "jest"] 5 | }, 6 | "include": ["**/*.ts"] 7 | } 8 | -------------------------------------------------------------------------------- /libs/section5/tsconfig.lib.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../dist/out-tsc", 5 | "target": "es2015", 6 | "declaration": true, 7 | "inlineSources": true, 8 | "types": [], 9 | "lib": ["dom", "es2018"] 10 | }, 11 | "angularCompilerOptions": { 12 | "annotateForClosureCompiler": true, 13 | "skipTemplateCodegen": true, 14 | "strictMetadataEmit": true, 15 | "fullTemplateTypeCheck": true, 16 | "strictInjectionParameters": true, 17 | "enableResourceInlining": true 18 | }, 19 | "exclude": ["src/test.ts", "**/*.spec.ts"] 20 | } 21 | -------------------------------------------------------------------------------- /libs/section5/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../dist/out-tsc", 5 | "module": "commonjs", 6 | "types": ["jest", "node"] 7 | }, 8 | "files": ["src/test-setup.ts"], 9 | "include": ["**/*.spec.ts", "**/*.d.ts"] 10 | } 11 | -------------------------------------------------------------------------------- /libs/section5/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tslint.json", 3 | "rules": { 4 | "directive-selector": [true, "attribute", "formsCourse", "camelCase"], 5 | "component-selector": [true, "element", "forms-course", "kebab-case"] 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /libs/section6/README.md: -------------------------------------------------------------------------------- 1 | # section6 2 | 3 | This library was generated with [Nx](https://nx.dev). 4 | 5 | ## Running unit tests 6 | 7 | Run `ng test section6` to execute the unit tests. 8 | -------------------------------------------------------------------------------- /libs/section6/jest.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | name: 'section6', 3 | preset: '../../jest.config.js', 4 | coverageDirectory: '../../coverage/libs/section6', 5 | snapshotSerializers: [ 6 | 'jest-preset-angular/AngularSnapshotSerializer.js', 7 | 'jest-preset-angular/HTMLCommentSerializer.js' 8 | ] 9 | }; 10 | -------------------------------------------------------------------------------- /libs/section6/src/index.ts: -------------------------------------------------------------------------------- 1 | export * from './lib/section6.module'; 2 | -------------------------------------------------------------------------------- /libs/section6/src/lib/+state/hero.reducer.ts: -------------------------------------------------------------------------------- 1 | import { name } from 'faker'; 2 | import { createReducer, Action } from '@ngrx/store'; 3 | import { Hero } from './hero.utils'; 4 | 5 | const createRandomHero = (): Hero => ({ 6 | name: name.findName(), 7 | attack: Math.ceil(Math.random() * 20), 8 | defense: Math.ceil(Math.random() * 20), 9 | speed: Math.ceil(Math.random() * 20), 10 | health: Math.ceil(Math.random() * 20) 11 | }); 12 | 13 | export const initialHeroes: Hero[] = new Array(1000) 14 | .fill({}) 15 | .reduce((acc, {}) => [...acc, createRandomHero()], []); 16 | 17 | const reducer = createReducer(initialHeroes); 18 | 19 | export function heroReducer(state: Hero[], action: Action) { 20 | return initialHeroes; 21 | } 22 | -------------------------------------------------------------------------------- /libs/section6/src/lib/+state/hero.selector.ts: -------------------------------------------------------------------------------- 1 | import { createFeatureSelector } from '@ngrx/store'; 2 | import { Hero } from './hero.utils'; 3 | 4 | export const heroSelector = createFeatureSelector('heroes'); 5 | -------------------------------------------------------------------------------- /libs/section6/src/lib/+state/hero.service.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed } from '@angular/core/testing'; 2 | 3 | import { HeroServiceService } from './hero-service.service'; 4 | 5 | describe('HeroServiceService', () => { 6 | beforeEach(() => TestBed.configureTestingModule({})); 7 | 8 | it('should be created', () => { 9 | const service: HeroServiceService = TestBed.get(HeroServiceService); 10 | expect(service).toBeTruthy(); 11 | }); 12 | }); 13 | -------------------------------------------------------------------------------- /libs/section6/src/lib/lesson1/completed/lesson1-completed-hero-grid/lesson1-completed-hero-grid.component.css: -------------------------------------------------------------------------------- 1 | [mat-sort-header] { 2 | padding: 20px; 3 | } 4 | 5 | ::ng-deep .mat-form-field-wrapper { 6 | padding-left: 20px; 7 | padding-right: 20px; 8 | } 9 | 10 | table { 11 | width: 100%; 12 | } 13 | 14 | .loading-shade { 15 | position: absolute; 16 | top: 0; 17 | bottom: 16px; 18 | left: 16px; 19 | right: 16px; 20 | margin-top: 196px; 21 | background: rgba(0, 0, 0, 0.15); 22 | z-index: 1; 23 | display: flex; 24 | align-items: center; 25 | justify-content: center; 26 | } 27 | 28 | .loading-shade.filters-on { 29 | margin-top: 261px; 30 | } 31 | -------------------------------------------------------------------------------- /libs/section6/src/lib/lesson1/completed/lesson1-completed-hero-grid/lesson1-completed-hero-grid.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { Lesson1CompletedHeroGridComponent } from './lesson1-completed-hero-grid.component'; 4 | 5 | describe('Lesson1CompletedHeroGridComponent', () => { 6 | let component: Lesson1CompletedHeroGridComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ Lesson1CompletedHeroGridComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(Lesson1CompletedHeroGridComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /libs/section6/src/lib/lesson1/completed/lesson1-completed-pagination-form/lesson1-completed-pagination-form.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nrwl/angular-reactive-forms-course/40af5ad1af54c453625f747e1ae20dc184ef10fd/libs/section6/src/lib/lesson1/completed/lesson1-completed-pagination-form/lesson1-completed-pagination-form.component.css -------------------------------------------------------------------------------- /libs/section6/src/lib/lesson1/completed/lesson1-completed-pagination-form/lesson1-completed-pagination-form.component.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 1 5 | ... 6 | 7 | 12 | {{ paginationOption }} 13 | 14 | 15 | ... 16 | {{ totalPages }} 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /libs/section6/src/lib/lesson1/completed/lesson1-completed-pagination-form/lesson1-completed-pagination-form.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { Lesson1CompletedPaginationFormComponent } from './lesson1-completed-pagination-form.component'; 4 | 5 | describe('Lesson1CompletedPaginationFormComponent', () => { 6 | let component: Lesson1CompletedPaginationFormComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ Lesson1CompletedPaginationFormComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(Lesson1CompletedPaginationFormComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /libs/section6/src/lib/lesson1/hero-grid/hero-grid.component.css: -------------------------------------------------------------------------------- 1 | [mat-sort-header] { 2 | padding: 20px; 3 | } 4 | 5 | ::ng-deep .mat-form-field-wrapper { 6 | padding-left: 20px; 7 | padding-right: 20px; 8 | } 9 | 10 | table { 11 | width: 100%; 12 | } 13 | 14 | .loading-shade { 15 | position: absolute; 16 | top: 0; 17 | bottom: 16px; 18 | left: 16px; 19 | right: 16px; 20 | margin-top: 196px; 21 | background: rgba(0, 0, 0, 0.15); 22 | z-index: 1; 23 | display: flex; 24 | align-items: center; 25 | justify-content: center; 26 | } 27 | 28 | .loading-shade.filters-on { 29 | margin-top: 261px; 30 | } 31 | -------------------------------------------------------------------------------- /libs/section6/src/lib/lesson1/hero-grid/hero-grid.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { HeroGridComponent } from './hero-grid.component'; 4 | 5 | describe('HeroGridComponent', () => { 6 | let component: HeroGridComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ HeroGridComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(HeroGridComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /libs/section6/src/lib/lesson1/lesson1-shell/lesson1-shell.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nrwl/angular-reactive-forms-course/40af5ad1af54c453625f747e1ae20dc184ef10fd/libs/section6/src/lib/lesson1/lesson1-shell/lesson1-shell.component.css -------------------------------------------------------------------------------- /libs/section6/src/lib/lesson1/lesson1-shell/lesson1-shell.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { Lesson1ShellComponent } from './lesson1-shell.component'; 4 | 5 | describe('Lesson1ShellComponent', () => { 6 | let component: Lesson1ShellComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ Lesson1ShellComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(Lesson1ShellComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /libs/section6/src/lib/lesson1/pagination-form/pagination-form.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nrwl/angular-reactive-forms-course/40af5ad1af54c453625f747e1ae20dc184ef10fd/libs/section6/src/lib/lesson1/pagination-form/pagination-form.component.css -------------------------------------------------------------------------------- /libs/section6/src/lib/lesson1/pagination-form/pagination-form.component.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 1 5 | ... 6 | 7 | 12 | {{ paginationOption }} 13 | 14 | 15 | ... 16 | {{ totalPages }} 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /libs/section6/src/lib/lesson1/pagination-form/pagination-form.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { PaginationFormComponent } from './pagination-form.component'; 4 | 5 | describe('PaginationFormComponent', () => { 6 | let component: PaginationFormComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ PaginationFormComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(PaginationFormComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /libs/section6/src/lib/lesson2/completed/lesson2-completed-table-form/lesson2-completed-table-form.component.css: -------------------------------------------------------------------------------- 1 | .filter { 2 | padding-right: 20px; 3 | } 4 | 5 | .column-filter { 6 | padding-right: 20px; 7 | } 8 | 9 | .pageSize { 10 | padding-right: 20px; 11 | } 12 | 13 | ::ng-deep mat-button-toggle-group { 14 | top: -5px; 15 | } 16 | -------------------------------------------------------------------------------- /libs/section6/src/lib/lesson2/completed/lesson2-completed-table-form/lesson2-completed-table-form.component.html: -------------------------------------------------------------------------------- 1 |
2 | 3 | Filter 4 | 5 | 6 | 7 | 8 | Enable Per-Column Filters 9 | 10 | 11 | 12 | Page Size 13 | 14 | 15 | {{ pageSize }} 16 | 17 | 18 | 19 | 20 | 25 |
26 | -------------------------------------------------------------------------------- /libs/section6/src/lib/lesson2/completed/lesson2-completed-table-form/lesson2-completed-table-form.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { Lesson2CompletedTableFormComponent } from './lesson2-completed-table-form.component'; 4 | 5 | describe('Lesson2CompletedTableFormComponent', () => { 6 | let component: Lesson2CompletedTableFormComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ Lesson2CompletedTableFormComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(Lesson2CompletedTableFormComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /libs/section6/src/lib/lesson2/lesson2-shell/lesson2-shell.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nrwl/angular-reactive-forms-course/40af5ad1af54c453625f747e1ae20dc184ef10fd/libs/section6/src/lib/lesson2/lesson2-shell/lesson2-shell.component.css -------------------------------------------------------------------------------- /libs/section6/src/lib/lesson2/lesson2-shell/lesson2-shell.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { Lesson2ShellComponent } from './lesson2-shell.component'; 4 | 5 | describe('Lesson2ShellComponent', () => { 6 | let component: Lesson2ShellComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ Lesson2ShellComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(Lesson2ShellComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /libs/section6/src/lib/lesson2/table-form/table-form.component.css: -------------------------------------------------------------------------------- 1 | .filter { 2 | padding-right: 20px; 3 | } 4 | 5 | .column-filter { 6 | padding-right: 20px; 7 | } 8 | 9 | .pageSize { 10 | padding-right: 20px; 11 | } 12 | 13 | ::ng-deep mat-button-toggle-group { 14 | top: -5px; 15 | } 16 | -------------------------------------------------------------------------------- /libs/section6/src/lib/lesson2/table-form/table-form.component.html: -------------------------------------------------------------------------------- 1 | 26 | -------------------------------------------------------------------------------- /libs/section6/src/lib/lesson2/table-form/table-form.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { TableFormComponent } from './table-form.component'; 4 | 5 | describe('TableFormComponent', () => { 6 | let component: TableFormComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ TableFormComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(TableFormComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /libs/section6/src/lib/lesson3/client-side-table/client-side-table.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nrwl/angular-reactive-forms-course/40af5ad1af54c453625f747e1ae20dc184ef10fd/libs/section6/src/lib/lesson3/client-side-table/client-side-table.component.css -------------------------------------------------------------------------------- /libs/section6/src/lib/lesson3/client-side-table/client-side-table.component.html: -------------------------------------------------------------------------------- 1 | 2 | Hero Table 3 | 4 | 5 | 9 | 10 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /libs/section6/src/lib/lesson3/client-side-table/client-side-table.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { ClientSideTableComponent } from './client-side-table.component'; 4 | 5 | describe('ClientSideTableComponent', () => { 6 | let component: ClientSideTableComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ ClientSideTableComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(ClientSideTableComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /libs/section6/src/lib/lesson3/completed/lesson3-completed-client-side-table/lesson3-completed-client-side-table.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nrwl/angular-reactive-forms-course/40af5ad1af54c453625f747e1ae20dc184ef10fd/libs/section6/src/lib/lesson3/completed/lesson3-completed-client-side-table/lesson3-completed-client-side-table.component.css -------------------------------------------------------------------------------- /libs/section6/src/lib/lesson3/completed/lesson3-completed-client-side-table/lesson3-completed-client-side-table.component.html: -------------------------------------------------------------------------------- 1 | 2 | Hero Table 3 | 4 | 5 | 9 | 10 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /libs/section6/src/lib/lesson3/lesson3-shell/lesson3-shell.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nrwl/angular-reactive-forms-course/40af5ad1af54c453625f747e1ae20dc184ef10fd/libs/section6/src/lib/lesson3/lesson3-shell/lesson3-shell.component.css -------------------------------------------------------------------------------- /libs/section6/src/lib/lesson3/lesson3-shell/lesson3-shell.component.html: -------------------------------------------------------------------------------- 1 | 2 |

3 | In this lesson, use table form and grid components to create a client-side 4 | table. 5 |

6 | 7 |

8 | Check out the resources in the `+state` directory for this section to help 9 | with the functionality. There is an NgRx implementation in `+state`, but the 10 | important part is to know that there's a selector called `heroSelector` that 11 | will provide an Observable of all available heroes. 12 |

13 |
14 | 15 | 19 | 22 | 25 | 26 | -------------------------------------------------------------------------------- /libs/section6/src/lib/lesson3/lesson3-shell/lesson3-shell.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { Lesson3ShellComponent } from './lesson3-shell.component'; 4 | 5 | describe('Lesson3ShellComponent', () => { 6 | let component: Lesson3ShellComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ Lesson3ShellComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(Lesson3ShellComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /libs/section6/src/lib/lesson4/completed/lesson4-completed-server-side-table/lesson4-completed-server-side-table.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nrwl/angular-reactive-forms-course/40af5ad1af54c453625f747e1ae20dc184ef10fd/libs/section6/src/lib/lesson4/completed/lesson4-completed-server-side-table/lesson4-completed-server-side-table.component.css -------------------------------------------------------------------------------- /libs/section6/src/lib/lesson4/completed/lesson4-completed-server-side-table/lesson4-completed-server-side-table.component.html: -------------------------------------------------------------------------------- 1 | 2 | Hero Table 3 | 4 | 5 | 9 | 10 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /libs/section6/src/lib/lesson4/lesson4-shell/lesson4-shell.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nrwl/angular-reactive-forms-course/40af5ad1af54c453625f747e1ae20dc184ef10fd/libs/section6/src/lib/lesson4/lesson4-shell/lesson4-shell.component.css -------------------------------------------------------------------------------- /libs/section6/src/lib/lesson4/lesson4-shell/lesson4-shell.component.html: -------------------------------------------------------------------------------- 1 | 2 |

3 | In this lesson, use the same table form and grid components to create a 4 | server-side table. 5 |

6 | 7 |

8 | Check out the utils and the HeroService in the `+state` directory for this 9 | section to help with addressing these. Use the HeroService for mocking out 10 | your API calls. 11 |

12 |
13 | 14 | 18 | 21 | 25 | -------------------------------------------------------------------------------- /libs/section6/src/lib/lesson4/lesson4-shell/lesson4-shell.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { Lesson4ShellComponent } from './lesson4-shell.component'; 4 | 5 | describe('Lesson4ShellComponent', () => { 6 | let component: Lesson4ShellComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ Lesson4ShellComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(Lesson4ShellComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /libs/section6/src/lib/lesson4/server-side-table/server-side-table.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nrwl/angular-reactive-forms-course/40af5ad1af54c453625f747e1ae20dc184ef10fd/libs/section6/src/lib/lesson4/server-side-table/server-side-table.component.css -------------------------------------------------------------------------------- /libs/section6/src/lib/lesson4/server-side-table/server-side-table.component.html: -------------------------------------------------------------------------------- 1 | 2 | Hero Table 3 | 4 | 5 | 9 | 10 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /libs/section6/src/lib/lesson4/server-side-table/server-side-table.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { ServerSideTableComponent } from './server-side-table.component'; 4 | 5 | describe('ServerSideTableComponent', () => { 6 | let component: ServerSideTableComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ ServerSideTableComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(ServerSideTableComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /libs/section6/src/lib/section6.module.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, TestBed } from '@angular/core/testing'; 2 | import { Section6Module } from './section6.module'; 3 | 4 | describe('Section6Module', () => { 5 | beforeEach(async(() => { 6 | TestBed.configureTestingModule({ 7 | imports: [Section6Module] 8 | }).compileComponents(); 9 | })); 10 | 11 | it('should create', () => { 12 | expect(Section6Module).toBeDefined(); 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /libs/section6/src/test-setup.ts: -------------------------------------------------------------------------------- 1 | import 'jest-preset-angular'; 2 | -------------------------------------------------------------------------------- /libs/section6/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "types": ["node", "jest"] 5 | }, 6 | "include": ["**/*.ts"] 7 | } 8 | -------------------------------------------------------------------------------- /libs/section6/tsconfig.lib.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../dist/out-tsc", 5 | "target": "es2015", 6 | "declaration": true, 7 | "inlineSources": true, 8 | "types": [], 9 | "lib": ["dom", "es2018"] 10 | }, 11 | "angularCompilerOptions": { 12 | "annotateForClosureCompiler": true, 13 | "skipTemplateCodegen": true, 14 | "strictMetadataEmit": true, 15 | "fullTemplateTypeCheck": true, 16 | "strictInjectionParameters": true, 17 | "enableResourceInlining": true 18 | }, 19 | "exclude": ["src/test.ts", "**/*.spec.ts"] 20 | } 21 | -------------------------------------------------------------------------------- /libs/section6/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../dist/out-tsc", 5 | "module": "commonjs", 6 | "types": ["jest", "node"] 7 | }, 8 | "files": ["src/test-setup.ts"], 9 | "include": ["**/*.spec.ts", "**/*.d.ts"] 10 | } 11 | -------------------------------------------------------------------------------- /libs/section6/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tslint.json", 3 | "rules": { 4 | "directive-selector": [true, "attribute", "formsCourse", "camelCase"], 5 | "component-selector": [true, "element", "forms-course", "kebab-case"] 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /libs/ui-common/README.md: -------------------------------------------------------------------------------- 1 | # ui-common 2 | 3 | This library was generated with [Nx](https://nx.dev). 4 | 5 | ## Running unit tests 6 | 7 | Run `ng test ui-common` to execute the unit tests. 8 | -------------------------------------------------------------------------------- /libs/ui-common/jest.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | name: 'ui-common', 3 | preset: '../../jest.config.js', 4 | coverageDirectory: '../../coverage/libs/ui-common', 5 | snapshotSerializers: [ 6 | 'jest-preset-angular/AngularSnapshotSerializer.js', 7 | 'jest-preset-angular/HTMLCommentSerializer.js' 8 | ] 9 | }; 10 | -------------------------------------------------------------------------------- /libs/ui-common/src/index.ts: -------------------------------------------------------------------------------- 1 | export * from './lib/ui-common.module'; 2 | export * from './lib/file-to-preview.interface'; 3 | export * from './lib/animations'; 4 | export * from './lib/lesson-frame/lesson-frame.component'; 5 | export * from './lib/lesson-frame.interface'; 6 | -------------------------------------------------------------------------------- /libs/ui-common/src/lib/animations.ts: -------------------------------------------------------------------------------- 1 | import { 2 | trigger, 3 | transition, 4 | animate, 5 | keyframes, 6 | style 7 | } from '@angular/animations'; 8 | 9 | export const animations = [ 10 | trigger('fadeout', [ 11 | transition( 12 | ':leave', 13 | animate( 14 | '1s', 15 | keyframes([ 16 | style({ opacity: '1', offset: 0, height: '*' }), 17 | style({ opacity: '0', offset: 0.5, height: '*' }), 18 | style({ opacity: '0', offset: 1, height: 0 }) 19 | ]) 20 | ) 21 | ) 22 | ]), 23 | trigger('fadein', [ 24 | transition( 25 | ':enter', 26 | animate( 27 | '1s', 28 | keyframes([ 29 | style({ opacity: '0', offset: 0, height: 0 }), 30 | style({ opacity: '0', offset: 0.5, height: '*' }), 31 | style({ opacity: '1', offset: 1, height: '*' }) 32 | ]) 33 | ) 34 | ) 35 | ]) 36 | ]; 37 | -------------------------------------------------------------------------------- /libs/ui-common/src/lib/code-preview/code-preview.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nrwl/angular-reactive-forms-course/40af5ad1af54c453625f747e1ae20dc184ef10fd/libs/ui-common/src/lib/code-preview/code-preview.component.css -------------------------------------------------------------------------------- /libs/ui-common/src/lib/code-preview/code-preview.component.html: -------------------------------------------------------------------------------- 1 |
2 | 
3 | 
4 | -------------------------------------------------------------------------------- /libs/ui-common/src/lib/code-preview/code-preview.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { CodePreviewComponent } from './code-preview.component'; 4 | 5 | describe('CodePreviewComponent', () => { 6 | let component: CodePreviewComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ CodePreviewComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(CodePreviewComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /libs/ui-common/src/lib/file-to-preview.interface.ts: -------------------------------------------------------------------------------- 1 | export type Language = 'typescript' | 'html'; 2 | 3 | export interface FileToPreview { 4 | fileName: string; 5 | fileContents: { default: string }; 6 | language: Language; 7 | } 8 | -------------------------------------------------------------------------------- /libs/ui-common/src/lib/instructions/instructions.component.css: -------------------------------------------------------------------------------- 1 | :host { 2 | background-color: #222222; 3 | color: white; 4 | } 5 | 6 | .alert { 7 | background-color: #333333; 8 | color: white; 9 | } 10 | -------------------------------------------------------------------------------- /libs/ui-common/src/lib/instructions/instructions.component.html: -------------------------------------------------------------------------------- 1 | 4 | -------------------------------------------------------------------------------- /libs/ui-common/src/lib/instructions/instructions.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { InstructionsComponent } from './instructions.component'; 4 | 5 | describe('InstructionsComponent', () => { 6 | let component: InstructionsComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ InstructionsComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(InstructionsComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /libs/ui-common/src/lib/instructions/instructions.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'forms-course-instructions', 5 | templateUrl: './instructions.component.html', 6 | styleUrls: ['./instructions.component.css'] 7 | }) 8 | export class InstructionsComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /libs/ui-common/src/lib/lesson-frame.interface.ts: -------------------------------------------------------------------------------- 1 | import { FileToPreview } from './file-to-preview.interface'; 2 | 3 | export interface LessonFrame { 4 | working: FileToPreview[]; 5 | completed: FileToPreview[]; 6 | } 7 | -------------------------------------------------------------------------------- /libs/ui-common/src/lib/lesson-frame/lesson-frame.component.css: -------------------------------------------------------------------------------- 1 | mat-card { 2 | max-width: 1250px; 3 | /* background-color: rgba(0, 169, 244, 0.1); */ 4 | background-color: #f6f6f6; 5 | } 6 | 7 | .example { 8 | display: grid; 9 | place-items: center; 10 | padding: 50px; 11 | border-color: black; 12 | border-width: 2px; 13 | border-radius: 10px; 14 | border-style: solid; 15 | } 16 | 17 | .tab-group-container { 18 | width: 100%; 19 | } 20 | 21 | mat-card-content { 22 | display: grid; 23 | place-items: center; 24 | } 25 | 26 | mat-tab-group { 27 | max-width: 1200px; 28 | } 29 | -------------------------------------------------------------------------------- /libs/ui-common/src/lib/lesson-frame/lesson-frame.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { LessonFrameComponent } from './lesson-frame.component'; 4 | 5 | describe('LessonFrameComponent', () => { 6 | let component: LessonFrameComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ LessonFrameComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(LessonFrameComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /libs/ui-common/src/lib/section-shell/section-shell.component.scss: -------------------------------------------------------------------------------- 1 | .active { 2 | background-color: #00a9f4; 3 | color: #fff; 4 | 5 | &:hover, 6 | &:active, 7 | &:focus { 8 | background-color: darken(#00a9f4, 5); 9 | } 10 | } 11 | 12 | a { 13 | transition: 1s; 14 | } 15 | 16 | a[mat-raised-button]:hover { 17 | text-decoration: none; 18 | color: inherit; 19 | } 20 | -------------------------------------------------------------------------------- /libs/ui-common/src/lib/section-shell/section-shell.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { SectionShellComponent } from './section-shell.component'; 4 | 5 | describe('SectionShellComponent', () => { 6 | let component: SectionShellComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ SectionShellComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(SectionShellComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /libs/ui-common/src/lib/ui-common.module.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, TestBed } from '@angular/core/testing'; 2 | import { UiCommonModule } from './ui-common.module'; 3 | 4 | describe('UiCommonModule', () => { 5 | beforeEach(async(() => { 6 | TestBed.configureTestingModule({ 7 | imports: [UiCommonModule] 8 | }).compileComponents(); 9 | })); 10 | 11 | it('should create', () => { 12 | expect(UiCommonModule).toBeDefined(); 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /libs/ui-common/src/test-setup.ts: -------------------------------------------------------------------------------- 1 | import 'jest-preset-angular'; 2 | -------------------------------------------------------------------------------- /libs/ui-common/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "types": ["node", "jest"] 5 | }, 6 | "include": ["**/*.ts"] 7 | } 8 | -------------------------------------------------------------------------------- /libs/ui-common/tsconfig.lib.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../dist/out-tsc", 5 | "target": "es2015", 6 | "declaration": true, 7 | "inlineSources": true, 8 | "types": ["node"], 9 | "lib": ["dom", "es2018"] 10 | }, 11 | "angularCompilerOptions": { 12 | "annotateForClosureCompiler": true, 13 | "skipTemplateCodegen": true, 14 | "strictMetadataEmit": true, 15 | "fullTemplateTypeCheck": true, 16 | "strictInjectionParameters": true, 17 | "enableResourceInlining": true 18 | }, 19 | "exclude": ["src/test.ts", "**/*.spec.ts"] 20 | } 21 | -------------------------------------------------------------------------------- /libs/ui-common/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../dist/out-tsc", 5 | "module": "commonjs", 6 | "types": ["jest", "node"] 7 | }, 8 | "files": ["src/test-setup.ts"], 9 | "include": ["**/*.spec.ts", "**/*.d.ts"] 10 | } 11 | -------------------------------------------------------------------------------- /libs/ui-common/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tslint.json", 3 | "rules": { 4 | "directive-selector": [true, "attribute", "formsCourse", "camelCase"], 5 | "component-selector": [true, "element", "forms-course", "kebab-case"] 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /nx.json: -------------------------------------------------------------------------------- 1 | { 2 | "npmScope": "forms-course", 3 | "implicitDependencies": { 4 | "angular.json": "*", 5 | "package.json": "*", 6 | "tsconfig.json": "*", 7 | "tslint.json": "*", 8 | "nx.json": "*" 9 | }, 10 | "tasksRunnerOptions": { 11 | "default": { 12 | "runner": "@nrwl/nx-cloud", 13 | "options": { 14 | "cacheableOperations": [ 15 | "build", 16 | "lint", 17 | "test", 18 | "e2e", 19 | "buildForProd", 20 | "deploy", 21 | "ci" 22 | ], 23 | "accessToken": "Y2YxZGUxMGMtYmExOS00OWYyLWIzZjgtYTM1ZGYxMDgxNjcwfHJlYWQtd3JpdGU=" 24 | } 25 | } 26 | } 27 | } 28 | --------------------------------------------------------------------------------