├── Chapter01 └── chapter1_quickstart │ ├── .editorconfig │ ├── .gitignore │ ├── README.md │ ├── angular.json │ ├── e2e │ ├── protractor.conf.js │ ├── src │ │ ├── app.e2e-spec.ts │ │ └── app.po.ts │ └── tsconfig.e2e.json │ ├── package-lock.json │ ├── package.json │ ├── src │ ├── app │ │ ├── app-routing.module.ts │ │ ├── app.component.html │ │ ├── app.component.scss │ │ ├── app.component.spec.ts │ │ ├── app.component.ts │ │ ├── app.module.ts │ │ ├── home │ │ │ ├── home.component.html │ │ │ ├── home.component.scss │ │ │ ├── home.component.spec.ts │ │ │ └── home.component.ts │ │ ├── todoitem │ │ │ ├── todoitem.component.html │ │ │ ├── todoitem.component.scss │ │ │ ├── todoitem.component.spec.ts │ │ │ └── todoitem.component.ts │ │ └── todolist │ │ │ ├── todolist.component.html │ │ │ ├── todolist.component.scss │ │ │ ├── todolist.component.spec.ts │ │ │ └── todolist.component.ts │ ├── assets │ │ └── .gitkeep │ ├── browserslist │ ├── environments │ │ ├── environment.prod.ts │ │ └── environment.ts │ ├── favicon.ico │ ├── index.html │ ├── karma.conf.js │ ├── main.ts │ ├── polyfills.ts │ ├── styles.scss │ ├── test.ts │ ├── tsconfig.app.json │ ├── tsconfig.spec.json │ └── tslint.json │ ├── tsconfig.json │ └── tslint.json ├── Chapter02 ├── chapter2_part1 │ ├── .editorconfig │ ├── .gitignore │ ├── README.md │ ├── angular.json │ ├── e2e │ │ ├── protractor.conf.js │ │ ├── src │ │ │ ├── app.e2e-spec.ts │ │ │ └── app.po.ts │ │ └── tsconfig.e2e.json │ ├── package-lock.json │ ├── package.json │ ├── src │ │ ├── app │ │ │ ├── app.component.css │ │ │ ├── app.component.html │ │ │ ├── app.component.spec.ts │ │ │ ├── app.component.ts │ │ │ ├── app.module.ts │ │ │ ├── cars.js │ │ │ └── cars.ts │ │ ├── assets │ │ │ └── .gitkeep │ │ ├── browserslist │ │ ├── environments │ │ │ ├── environment.prod.ts │ │ │ └── environment.ts │ │ ├── favicon.ico │ │ ├── index.html │ │ ├── karma.conf.js │ │ ├── main.ts │ │ ├── polyfills.ts │ │ ├── styles.css │ │ ├── test.ts │ │ ├── tsconfig.app.json │ │ ├── tsconfig.spec.json │ │ └── tslint.json │ ├── tsconfig.json │ └── tslint.json └── chapter2_part2 │ ├── alphafunctions.js │ ├── alphafunctions.ts │ ├── cars.js │ ├── cars.ts │ ├── decorator.js │ ├── decorator.ts │ ├── destruction.js │ ├── destruction.ts │ ├── employees.js │ ├── employees.ts │ ├── examples.js │ ├── examples.ts │ ├── forLoop.js │ ├── forLoop.ts │ ├── interfaces.ts │ ├── main.js │ ├── main.ts │ ├── new 5.txt │ └── package.json ├── Chapter03 ├── chapter3-bootstrap │ ├── homepage.html │ ├── index.html │ ├── index2.html │ ├── listings.html │ └── signup.html └── chapter3_bootstrap │ ├── index.html │ └── index2.html ├── Chapter04 └── chapter4_routing │ ├── .editorconfig │ ├── .gitignore │ ├── README.md │ ├── angular.json │ ├── e2e │ ├── protractor.conf.js │ ├── src │ │ ├── app.e2e-spec.ts │ │ └── app.po.ts │ └── tsconfig.e2e.json │ ├── package-lock.json │ ├── package.json │ ├── src │ ├── app │ │ ├── activate-admin.guard.spec.ts │ │ ├── activate-admin.guard.ts │ │ ├── app-routing.module.ts │ │ ├── app.component.html │ │ ├── app.component.scss │ │ ├── app.component.spec.ts │ │ ├── app.component.ts │ │ ├── app.module.ts │ │ ├── crud │ │ │ ├── crud.component.html │ │ │ ├── crud.component.scss │ │ │ ├── crud.component.spec.ts │ │ │ └── crud.component.ts │ │ ├── home │ │ │ ├── home.component.html │ │ │ ├── home.component.scss │ │ │ ├── home.component.spec.ts │ │ │ └── home.component.ts │ │ ├── listing-details │ │ │ ├── listing-details.component.html │ │ │ ├── listing-details.component.scss │ │ │ ├── listing-details.component.spec.ts │ │ │ └── listing-details.component.ts │ │ ├── listings │ │ │ ├── listings.component.html │ │ │ ├── listings.component.scss │ │ │ ├── listings.component.spec.ts │ │ │ └── listings.component.ts │ │ └── menu │ │ │ ├── menu.component.html │ │ │ ├── menu.component.scss │ │ │ ├── menu.component.spec.ts │ │ │ └── menu.component.ts │ ├── assets │ │ └── .gitkeep │ ├── browserslist │ ├── environments │ │ ├── environment.prod.ts │ │ └── environment.ts │ ├── favicon.ico │ ├── index.html │ ├── karma.conf.js │ ├── main.ts │ ├── polyfills.ts │ ├── styles.scss │ ├── test.ts │ ├── tsconfig.app.json │ ├── tsconfig.spec.json │ └── tslint.json │ ├── tsconfig.json │ └── tslint.json ├── Chapter05 ├── chapter5-flex │ ├── .editorconfig │ ├── .gitignore │ ├── README.md │ ├── angular.json │ ├── e2e │ │ ├── protractor.conf.js │ │ ├── src │ │ │ ├── app.e2e-spec.ts │ │ │ └── app.po.ts │ │ └── tsconfig.e2e.json │ ├── package-lock.json │ ├── package.json │ ├── src │ │ ├── app │ │ │ ├── app-routing.module.ts │ │ │ ├── app.component.css │ │ │ ├── app.component.html │ │ │ ├── app.component.spec.ts │ │ │ ├── app.component.ts │ │ │ ├── app.module.ts │ │ │ ├── create-listing │ │ │ │ ├── create-listing.component.css │ │ │ │ ├── create-listing.component.html │ │ │ │ ├── create-listing.component.spec.ts │ │ │ │ └── create-listing.component.ts │ │ │ └── edit-listing │ │ │ │ ├── edit-listing.component.css │ │ │ │ ├── edit-listing.component.html │ │ │ │ ├── edit-listing.component.spec.ts │ │ │ │ └── edit-listing.component.ts │ │ ├── assets │ │ │ └── .gitkeep │ │ ├── browserslist │ │ ├── environments │ │ │ ├── environment.prod.ts │ │ │ └── environment.ts │ │ ├── favicon.ico │ │ ├── index.html │ │ ├── karma.conf.js │ │ ├── main.ts │ │ ├── polyfills.ts │ │ ├── styles.css │ │ ├── test.ts │ │ ├── tsconfig.app.json │ │ ├── tsconfig.spec.json │ │ └── tslint.json │ ├── tsconfig.json │ └── tslint.json └── chapter5_flex │ ├── .editorconfig │ ├── .gitignore │ ├── README.md │ ├── angular.json │ ├── e2e │ ├── protractor.conf.js │ ├── src │ │ ├── app.e2e-spec.ts │ │ └── app.po.ts │ └── tsconfig.e2e.json │ ├── package-lock.json │ ├── package.json │ ├── src │ ├── app │ │ ├── app.component.css │ │ ├── app.component.html │ │ ├── app.component.spec.ts │ │ ├── app.component.ts │ │ └── app.module.ts │ ├── assets │ │ └── .gitkeep │ ├── browserslist │ ├── environments │ │ ├── environment.prod.ts │ │ └── environment.ts │ ├── favicon.ico │ ├── index.html │ ├── karma.conf.js │ ├── main.ts │ ├── polyfills.ts │ ├── styles.css │ ├── test.ts │ ├── tsconfig.app.json │ ├── tsconfig.spec.json │ └── tslint.json │ ├── tsconfig.json │ └── tslint.json ├── Chapter06 └── chapter6_angularComponents │ ├── .editorconfig │ ├── .gitignore │ ├── README.md │ ├── angular.json │ ├── e2e │ ├── protractor.conf.js │ ├── src │ │ ├── app.e2e-spec.ts │ │ └── app.po.ts │ └── tsconfig.e2e.json │ ├── package-lock.json │ ├── package.json │ ├── src │ ├── app │ │ ├── app-routing.module.ts │ │ ├── app.component.html │ │ ├── app.component.scss │ │ ├── app.component.spec.ts │ │ ├── app.component.ts │ │ ├── app.module.ts │ │ ├── car │ │ │ ├── car.component.html │ │ │ ├── car.component.scss │ │ │ ├── car.component.spec.ts │ │ │ └── car.component.ts │ │ ├── dad │ │ │ ├── dad.component.html │ │ │ ├── dad.component.scss │ │ │ ├── dad.component.spec.ts │ │ │ ├── dad.component.ts │ │ │ └── son.component.ts │ │ ├── photo-listing │ │ │ ├── photo-listing.component.html │ │ │ ├── photo-listing.component.scss │ │ │ ├── photo-listing.component.spec.ts │ │ │ └── photo-listing.component.ts │ │ ├── preview-listing │ │ │ ├── preview-listing.component.html │ │ │ ├── preview-listing.component.scss │ │ │ ├── preview-listing.component.spec.ts │ │ │ └── preview-listing.component.ts │ │ └── preview-photos │ │ │ ├── preview-photos.component.html │ │ │ ├── preview-photos.component.scss │ │ │ ├── preview-photos.component.spec.ts │ │ │ └── preview-photos.component.ts │ ├── assets │ │ └── .gitkeep │ ├── browserslist │ ├── environments │ │ ├── environment.prod.ts │ │ └── environment.ts │ ├── favicon.ico │ ├── index.html │ ├── karma.conf.js │ ├── main.ts │ ├── polyfills.ts │ ├── styles.scss │ ├── test.ts │ ├── tsconfig.app.json │ ├── tsconfig.spec.json │ └── tslint.json │ ├── tsconfig.json │ └── tslint.json ├── Chapter07 └── chapter7_templates │ ├── .editorconfig │ ├── .gitignore │ ├── README.md │ ├── angular.json │ ├── e2e │ ├── protractor.conf.js │ ├── src │ │ ├── app.e2e-spec.ts │ │ └── app.po.ts │ └── tsconfig.e2e.json │ ├── package-lock.json │ ├── package.json │ ├── src │ ├── app │ │ ├── app-routing.module.ts │ │ ├── app.component.html │ │ ├── app.component.scss │ │ ├── app.component.spec.ts │ │ ├── app.component.ts │ │ ├── app.module.ts │ │ ├── carhorsepower.component.ts │ │ └── carhorsepower2.component.ts │ ├── assets │ │ └── .gitkeep │ ├── browserslist │ ├── environments │ │ ├── environment.prod.ts │ │ └── environment.ts │ ├── favicon.ico │ ├── index.html │ ├── karma.conf.js │ ├── main.ts │ ├── polyfills.ts │ ├── styles.scss │ ├── test.ts │ ├── tsconfig.app.json │ ├── tsconfig.spec.json │ └── tslint.json │ ├── tsconfig.json │ └── tslint.json ├── Chapter08 └── chapter8_ngBootstrap │ ├── .editorconfig │ ├── .gitignore │ ├── README.md │ ├── angular.json │ ├── e2e │ ├── protractor.conf.js │ ├── src │ │ ├── app.e2e-spec.ts │ │ └── app.po.ts │ └── tsconfig.e2e.json │ ├── package-lock.json │ ├── package.json │ ├── src │ ├── app │ │ ├── app-routing.module.ts │ │ ├── app.component.html │ │ ├── app.component.scss │ │ ├── app.component.spec.ts │ │ ├── app.component.ts │ │ ├── app.module.ts │ │ ├── ngb-carousel │ │ │ ├── ngb-carousel.component.html │ │ │ ├── ngb-carousel.component.scss │ │ │ ├── ngb-carousel.component.spec.ts │ │ │ └── ngb-carousel.component.ts │ │ ├── ngb-collapse │ │ │ ├── ngb-collapse.component.html │ │ │ ├── ngb-collapse.component.scss │ │ │ ├── ngb-collapse.component.spec.ts │ │ │ └── ngb-collapse.component.ts │ │ ├── ngb-modal │ │ │ ├── ngb-modal.component.html │ │ │ ├── ngb-modal.component.scss │ │ │ ├── ngb-modal.component.spec.ts │ │ │ └── ngb-modal.component.ts │ │ └── playground │ │ │ ├── playground.component.html │ │ │ ├── playground.component.scss │ │ │ ├── playground.component.spec.ts │ │ │ └── playground.component.ts │ ├── assets │ │ └── .gitkeep │ ├── browserslist │ ├── environments │ │ ├── environment.prod.ts │ │ └── environment.ts │ ├── favicon.ico │ ├── index.html │ ├── karma.conf.js │ ├── main.ts │ ├── polyfills.ts │ ├── styles.scss │ ├── test.ts │ ├── tsconfig.app.json │ ├── tsconfig.spec.json │ └── tslint.json │ ├── tsconfig.json │ └── tslint.json ├── Chapter09 └── chapter9_angularMaterial │ ├── .editorconfig │ ├── .gitignore │ ├── README.md │ ├── angular.json │ ├── e2e │ ├── protractor.conf.js │ ├── src │ │ ├── app.e2e-spec.ts │ │ └── app.po.ts │ └── tsconfig.e2e.json │ ├── package-lock.json │ ├── package.json │ ├── src │ ├── app │ │ ├── add-dialog │ │ │ ├── add-dialog.component.html │ │ │ ├── add-dialog.component.scss │ │ │ ├── add-dialog.component.spec.ts │ │ │ └── add-dialog.component.ts │ │ ├── app-routing.module.ts │ │ ├── app.component.html │ │ ├── app.component.scss │ │ ├── app.component.spec.ts │ │ ├── app.component.ts │ │ ├── app.module.ts │ │ ├── bootstrap-material-combo │ │ │ ├── bootstrap-material-combo.component.html │ │ │ ├── bootstrap-material-combo.component.scss │ │ │ ├── bootstrap-material-combo.component.spec.ts │ │ │ └── bootstrap-material-combo.component.ts │ │ ├── issue-list │ │ │ ├── issue-list-datasource.ts │ │ │ ├── issue-list.component.css │ │ │ ├── issue-list.component.html │ │ │ ├── issue-list.component.spec.ts │ │ │ └── issue-list.component.ts │ │ ├── material-buttons │ │ │ ├── material-buttons.component.html │ │ │ ├── material-buttons.component.scss │ │ │ ├── material-buttons.component.spec.ts │ │ │ └── material-buttons.component.ts │ │ ├── material-cards │ │ │ ├── material-cards.component.html │ │ │ ├── material-cards.component.scss │ │ │ ├── material-cards.component.spec.ts │ │ │ └── material-cards.component.ts │ │ ├── material-form │ │ │ ├── material-form.component.html │ │ │ ├── material-form.component.scss │ │ │ ├── material-form.component.spec.ts │ │ │ └── material-form.component.ts │ │ ├── material-layout │ │ │ ├── material-layout.component.html │ │ │ ├── material-layout.component.scss │ │ │ ├── material-layout.component.spec.ts │ │ │ └── material-layout.component.ts │ │ ├── material-modals │ │ │ ├── create-new.html │ │ │ ├── material-modals.component.html │ │ │ ├── material-modals.component.scss │ │ │ ├── material-modals.component.spec.ts │ │ │ └── material-modals.component.ts │ │ ├── material-navigation │ │ │ ├── material-navigation.component.html │ │ │ ├── material-navigation.component.scss │ │ │ ├── material-navigation.component.spec.ts │ │ │ └── material-navigation.component.ts │ │ ├── material-table │ │ │ ├── material-table.component.html │ │ │ ├── material-table.component.scss │ │ │ ├── material-table.component.spec.ts │ │ │ └── material-table.component.ts │ │ └── my-menu │ │ │ ├── my-menu.component.css │ │ │ ├── my-menu.component.html │ │ │ ├── my-menu.component.spec.ts │ │ │ └── my-menu.component.ts │ ├── assets │ │ └── .gitkeep │ ├── browserslist │ ├── environments │ │ ├── environment.prod.ts │ │ └── environment.ts │ ├── favicon.ico │ ├── index.html │ ├── karma.conf.js │ ├── main.ts │ ├── polyfills.ts │ ├── styles.scss │ ├── test.ts │ ├── tsconfig.app.json │ ├── tsconfig.spec.json │ └── tslint.json │ ├── tsconfig.json │ └── tslint.json ├── Chapter10 └── chapter10_angularforms │ ├── .editorconfig │ ├── .gitignore │ ├── README.md │ ├── angular.json │ ├── e2e │ ├── protractor.conf.js │ ├── src │ │ ├── app.e2e-spec.ts │ │ └── app.po.ts │ └── tsconfig.e2e.json │ ├── package-lock.json │ ├── package.json │ ├── src │ ├── app │ │ ├── activate-admin.guard.spec.ts │ │ ├── activate-admin.guard.ts │ │ ├── app-routing.module.ts │ │ ├── app.component.html │ │ ├── app.component.scss │ │ ├── app.component.spec.ts │ │ ├── app.component.ts │ │ ├── app.module.ts │ │ ├── crud │ │ │ ├── crud.component.html │ │ │ ├── crud.component.scss │ │ │ ├── crud.component.spec.ts │ │ │ └── crud.component.ts │ │ ├── login │ │ │ ├── login.component.html │ │ │ ├── login.component.scss │ │ │ ├── login.component.spec.ts │ │ │ └── login.component.ts │ │ ├── payment-page │ │ │ ├── payment-page.component.html │ │ │ ├── payment-page.component.scss │ │ │ ├── payment-page.component.spec.ts │ │ │ └── payment-page.component.ts │ │ ├── photos.guard.spec.ts │ │ ├── photos.guard.ts │ │ └── register │ │ │ ├── register.component.html │ │ │ ├── register.component.scss │ │ │ ├── register.component.spec.ts │ │ │ └── register.component.ts │ ├── assets │ │ └── .gitkeep │ ├── browserslist │ ├── environments │ │ ├── environment.prod.ts │ │ └── environment.ts │ ├── favicon.ico │ ├── index.html │ ├── karma.conf.js │ ├── main.ts │ ├── polyfills.ts │ ├── styles.scss │ ├── test.ts │ ├── tsconfig.app.json │ ├── tsconfig.spec.json │ └── tslint.json │ ├── tsconfig.json │ └── tslint.json ├── Chapter11 └── chapter11_di_services │ ├── .editorconfig │ ├── .gitignore │ ├── README.md │ ├── angular.json │ ├── e2e │ ├── protractor.conf.js │ ├── src │ │ ├── app.e2e-spec.ts │ │ └── app.po.ts │ └── tsconfig.e2e.json │ ├── package-lock.json │ ├── package.json │ ├── src │ ├── app │ │ ├── app.component.css │ │ ├── app.component.html │ │ ├── app.component.spec.ts │ │ ├── app.component.ts │ │ ├── app.module.ts │ │ ├── photo.ts │ │ ├── photos.service.spec.ts │ │ └── photos.service.ts │ ├── assets │ │ └── .gitkeep │ ├── browserslist │ ├── environments │ │ ├── environment.prod.ts │ │ └── environment.ts │ ├── favicon.ico │ ├── index.html │ ├── karma.conf.js │ ├── main.ts │ ├── polyfills.ts │ ├── styles.css │ ├── test.ts │ ├── tsconfig.app.json │ ├── tsconfig.spec.json │ └── tslint.json │ ├── tsconfig.json │ └── tslint.json ├── Chapter12 └── chapter12_angular_backend │ ├── .editorconfig │ ├── .gitignore │ ├── README.md │ ├── angular.json │ ├── e2e │ ├── protractor.conf.js │ ├── src │ │ ├── app.e2e-spec.ts │ │ └── app.po.ts │ └── tsconfig.e2e.json │ ├── package-lock.json │ ├── package.json │ ├── src │ ├── app │ │ ├── add-comments │ │ │ ├── add-comments.component.html │ │ │ ├── add-comments.component.scss │ │ │ ├── add-comments.component.spec.ts │ │ │ └── add-comments.component.ts │ │ ├── apis │ │ │ ├── data.json │ │ │ └── listings.json │ │ ├── app-routing.module.ts │ │ ├── app.component.html │ │ ├── app.component.scss │ │ ├── app.component.spec.ts │ │ ├── app.component.ts │ │ ├── app.module.ts │ │ ├── create-listing │ │ │ ├── create-listing.component.html │ │ │ ├── create-listing.component.scss │ │ │ ├── create-listing.component.spec.ts │ │ │ └── create-listing.component.ts │ │ ├── crud-service.service.spec.ts │ │ ├── crud-service.service.ts │ │ ├── db-operations.service.spec.ts │ │ ├── db-operations.service.ts │ │ ├── delete-comments │ │ │ ├── delete-comments.component.html │ │ │ ├── delete-comments.component.scss │ │ │ ├── delete-comments.component.spec.ts │ │ │ └── delete-comments.component.ts │ │ ├── delete-listing │ │ │ ├── delete-listing.component.html │ │ │ ├── delete-listing.component.scss │ │ │ ├── delete-listing.component.spec.ts │ │ │ └── delete-listing.component.ts │ │ ├── edit-comments │ │ │ ├── edit-comments.component.html │ │ │ ├── edit-comments.component.scss │ │ │ ├── edit-comments.component.spec.ts │ │ │ └── edit-comments.component.ts │ │ ├── firebase-config.ts │ │ ├── models │ │ │ └── listing.ts │ │ ├── update-listing │ │ │ ├── update-listing.component.html │ │ │ ├── update-listing.component.scss │ │ │ ├── update-listing.component.spec.ts │ │ │ └── update-listing.component.ts │ │ ├── view-comments │ │ │ ├── view-comments.component.html │ │ │ ├── view-comments.component.scss │ │ │ ├── view-comments.component.spec.ts │ │ │ └── view-comments.component.ts │ │ └── view-listing │ │ │ ├── view-listing.component.html │ │ │ ├── view-listing.component.scss │ │ │ ├── view-listing.component.spec.ts │ │ │ └── view-listing.component.ts │ ├── assets │ │ └── .gitkeep │ ├── browserslist │ ├── environments │ │ ├── environment.prod.ts │ │ └── environment.ts │ ├── favicon.ico │ ├── index.html │ ├── karma.conf.js │ ├── main.ts │ ├── polyfills.ts │ ├── styles.scss │ ├── test.ts │ ├── tsconfig.app.json │ ├── tsconfig.spec.json │ └── tslint.json │ ├── tsconfig.json │ └── tslint.json ├── Chapter13 ├── chapter_13_testing │ ├── .editorconfig │ ├── .gitignore │ ├── README.md │ ├── angular.json │ ├── e2e │ │ ├── protractor.conf.js │ │ ├── src │ │ │ ├── app.e2e-spec.ts │ │ │ └── app.po.ts │ │ └── tsconfig.e2e.json │ ├── package-lock.json │ ├── package.json │ ├── src │ │ ├── app │ │ │ ├── app-routing.module.ts │ │ │ ├── app.component.html │ │ │ ├── app.component.scss │ │ │ ├── app.component.spec.ts │ │ │ ├── app.component.ts │ │ │ ├── app.module.ts │ │ │ ├── auto-list │ │ │ │ ├── auto-list.component.html │ │ │ │ ├── auto-list.component.scss │ │ │ │ ├── auto-list.component.spec.ts │ │ │ │ └── auto-list.component.ts │ │ │ ├── cars.ts │ │ │ ├── menu │ │ │ │ ├── menu.component.html │ │ │ │ ├── menu.component.scss │ │ │ │ ├── menu.component.spec.ts │ │ │ │ └── menu.component.ts │ │ │ ├── services │ │ │ │ ├── cars.json │ │ │ │ ├── dealers.service.spec.ts │ │ │ │ ├── dealers.service.ts │ │ │ │ └── dealers.ts │ │ │ └── used-cars │ │ │ │ ├── used-cars.component.html │ │ │ │ ├── used-cars.component.scss │ │ │ │ ├── used-cars.component.spec.ts │ │ │ │ └── used-cars.component.ts │ │ ├── assets │ │ │ └── .gitkeep │ │ ├── browserslist │ │ ├── environments │ │ │ ├── environment.prod.ts │ │ │ └── environment.ts │ │ ├── favicon.ico │ │ ├── index.html │ │ ├── karma.conf.js │ │ ├── main.ts │ │ ├── polyfills.ts │ │ ├── styles.scss │ │ ├── test.ts │ │ ├── tsconfig.app.json │ │ ├── tsconfig.spec.json │ │ └── tslint.json │ ├── tsconfig.json │ └── tslint.json └── chapter_13_unit_tests │ ├── .editorconfig │ ├── .gitignore │ ├── README.md │ ├── angular.json │ ├── e2e │ ├── protractor.conf.js │ ├── src │ │ ├── app.e2e-spec.ts │ │ └── app.po.ts │ └── tsconfig.e2e.json │ ├── package-lock.json │ ├── package.json │ ├── src │ ├── app │ │ ├── app-routing.module.ts │ │ ├── app.component.html │ │ ├── app.component.scss │ │ ├── app.component.spec.ts │ │ ├── app.component.ts │ │ ├── app.module.ts │ │ ├── auto-list │ │ │ ├── auto-list.component.html │ │ │ ├── auto-list.component.scss │ │ │ ├── auto-list.component.spec.ts │ │ │ └── auto-list.component.ts │ │ ├── cars.ts │ │ ├── menu │ │ │ ├── menu.component.html │ │ │ ├── menu.component.scss │ │ │ ├── menu.component.spec.ts │ │ │ └── menu.component.ts │ │ ├── services │ │ │ ├── cars.json │ │ │ ├── dealers.service.spec.ts │ │ │ ├── dealers.service.ts │ │ │ └── dealers.ts │ │ └── used-cars │ │ │ ├── used-cars.component.html │ │ │ ├── used-cars.component.scss │ │ │ ├── used-cars.component.spec.ts │ │ │ └── used-cars.component.ts │ ├── assets │ │ └── .gitkeep │ ├── browserslist │ ├── environments │ │ ├── environment.prod.ts │ │ └── environment.ts │ ├── favicon.ico │ ├── index.html │ ├── karma.conf.js │ ├── main.ts │ ├── polyfills.ts │ ├── styles.scss │ ├── test.ts │ ├── tsconfig.app.json │ ├── tsconfig.spec.json │ └── tslint.json │ ├── tsconfig.json │ └── tslint.json ├── Chapter14 ├── chapter14-firebase-app │ ├── .editorconfig │ ├── .gitignore │ ├── README.md │ ├── angular.json │ ├── e2e │ │ ├── protractor.conf.js │ │ ├── src │ │ │ ├── app.e2e-spec.ts │ │ │ └── app.po.ts │ │ └── tsconfig.e2e.json │ ├── package-lock.json │ ├── package.json │ ├── src │ │ ├── app │ │ │ ├── app-auth.service.spec.ts │ │ │ ├── app-auth.service.ts │ │ │ ├── app-routing.module.ts │ │ │ ├── app.component.html │ │ │ ├── app.component.scss │ │ │ ├── app.component.spec.ts │ │ │ ├── app.component.ts │ │ │ ├── app.module.ts │ │ │ ├── custom-form-validation │ │ │ │ ├── custom-form-validation.component.html │ │ │ │ ├── custom-form-validation.component.scss │ │ │ │ ├── custom-form-validation.component.spec.ts │ │ │ │ └── custom-form-validation.component.ts │ │ │ ├── login │ │ │ │ ├── login.component.html │ │ │ │ ├── login.component.scss │ │ │ │ ├── login.component.spec.ts │ │ │ │ └── login.component.ts │ │ │ ├── logout │ │ │ │ ├── logout.component.html │ │ │ │ ├── logout.component.scss │ │ │ │ ├── logout.component.spec.ts │ │ │ │ └── logout.component.ts │ │ │ ├── profile │ │ │ │ ├── profile.component.html │ │ │ │ ├── profile.component.scss │ │ │ │ ├── profile.component.spec.ts │ │ │ │ └── profile.component.ts │ │ │ ├── valid-isbn.directive.spec.ts │ │ │ └── valid-isbn.directive.ts │ │ ├── assets │ │ │ └── .gitkeep │ │ ├── browserslist │ │ ├── environments │ │ │ ├── environment.prod.ts │ │ │ └── environment.ts │ │ ├── favicon.ico │ │ ├── index.html │ │ ├── karma.conf.js │ │ ├── main.ts │ │ ├── polyfills.ts │ │ ├── styles.scss │ │ ├── test.ts │ │ ├── tsconfig.app.json │ │ ├── tsconfig.spec.json │ │ └── tslint.json │ ├── tsconfig.json │ ├── tslint.json │ └── yarn.lock ├── chapter14_auth0 │ ├── .editorconfig │ ├── .gitignore │ ├── README.md │ ├── angular.json │ ├── e2e │ │ ├── protractor.conf.js │ │ ├── src │ │ │ ├── app.e2e-spec.ts │ │ │ └── app.po.ts │ │ └── tsconfig.e2e.json │ ├── package-lock.json │ ├── package.json │ ├── src │ │ ├── app │ │ │ ├── app-routing.module.ts │ │ │ ├── app.component.html │ │ │ ├── app.component.scss │ │ │ ├── app.component.spec.ts │ │ │ ├── app.component.ts │ │ │ ├── app.module.ts │ │ │ ├── login │ │ │ │ ├── login.component.html │ │ │ │ ├── login.component.scss │ │ │ │ ├── login.component.spec.ts │ │ │ │ └── login.component.ts │ │ │ ├── profile │ │ │ │ ├── profile.component.html │ │ │ │ ├── profile.component.scss │ │ │ │ ├── profile.component.spec.ts │ │ │ │ └── profile.component.ts │ │ │ └── services │ │ │ │ ├── auth.service.spec.ts │ │ │ │ └── auth.service.ts │ │ ├── assets │ │ │ └── .gitkeep │ │ ├── browserslist │ │ ├── environments │ │ │ ├── environment.prod.ts │ │ │ └── environment.ts │ │ ├── favicon.ico │ │ ├── index.html │ │ ├── karma.conf.js │ │ ├── main.ts │ │ ├── polyfills.ts │ │ ├── styles.scss │ │ ├── test.ts │ │ ├── tsconfig.app.json │ │ ├── tsconfig.spec.json │ │ └── tslint.json │ ├── tsconfig.json │ ├── tslint.json │ └── yarn.lock └── chapter14_part1 │ ├── .editorconfig │ ├── .gitignore │ ├── README.md │ ├── angular.json │ ├── e2e │ ├── protractor.conf.js │ ├── src │ │ ├── app.e2e-spec.ts │ │ └── app.po.ts │ └── tsconfig.e2e.json │ ├── package-lock.json │ ├── package.json │ ├── src │ ├── app │ │ ├── app-routing.module.ts │ │ ├── app.component.html │ │ ├── app.component.scss │ │ ├── app.component.spec.ts │ │ ├── app.component.ts │ │ ├── app.module.ts │ │ ├── custom-form-validator.ts │ │ ├── on-focus-blur.directive.spec.ts │ │ └── on-focus-blur.directive.ts │ ├── assets │ │ └── .gitkeep │ ├── browserslist │ ├── environments │ │ ├── environment.prod.ts │ │ └── environment.ts │ ├── favicon.ico │ ├── index.html │ ├── karma.conf.js │ ├── main.ts │ ├── polyfills.ts │ ├── styles.scss │ ├── test.ts │ ├── tsconfig.app.json │ ├── tsconfig.spec.json │ └── tslint.json │ ├── tsconfig.json │ └── tslint.json ├── Chapter15 ├── chapter15_part1 │ ├── .editorconfig │ ├── .gitignore │ ├── README.md │ ├── angular.json │ ├── e2e │ │ ├── protractor.conf.js │ │ ├── src │ │ │ ├── app.e2e-spec.ts │ │ │ └── app.po.ts │ │ └── tsconfig.e2e.json │ ├── package-lock.json │ ├── package.json │ ├── src │ │ ├── app │ │ │ ├── app-routing.module.ts │ │ │ ├── app.component.html │ │ │ ├── app.component.scss │ │ │ ├── app.component.spec.ts │ │ │ ├── app.component.ts │ │ │ ├── app.module.ts │ │ │ ├── brands.ts │ │ │ ├── cars │ │ │ │ ├── cars.component.html │ │ │ │ ├── cars.component.scss │ │ │ │ ├── cars.component.spec.ts │ │ │ │ └── cars.component.ts │ │ │ ├── list-images │ │ │ │ ├── list-images.component.html │ │ │ │ ├── list-images.component.scss │ │ │ │ ├── list-images.component.spec.ts │ │ │ │ └── list-images.component.ts │ │ │ ├── testing-di │ │ │ │ ├── images.service.spec.ts │ │ │ │ └── images.service.ts │ │ │ ├── vehicles.service.spec.ts │ │ │ └── vehicles.service.ts │ │ ├── assets │ │ │ └── .gitkeep │ │ ├── browserslist │ │ ├── environments │ │ │ ├── environment.prod.ts │ │ │ └── environment.ts │ │ ├── favicon.ico │ │ ├── index.html │ │ ├── karma.conf.js │ │ ├── main.ts │ │ ├── polyfills.ts │ │ ├── styles.scss │ │ ├── test.ts │ │ ├── tsconfig.app.json │ │ ├── tsconfig.spec.json │ │ └── tslint.json │ ├── tsconfig.json │ └── tslint.json └── chapter_15_deploying_angular_part2 │ ├── .editorconfig │ ├── .gitignore │ ├── README.md │ ├── angular.json │ ├── e2e │ ├── protractor.conf.js │ ├── src │ │ ├── app.e2e-spec.ts │ │ └── app.po.ts │ └── tsconfig.e2e.json │ ├── package-lock.json │ ├── package.json │ ├── projects │ ├── jackets-e2e │ │ ├── protractor.conf.js │ │ ├── src │ │ │ ├── app.e2e-spec.ts │ │ │ └── app.po.ts │ │ └── tsconfig.e2e.json │ ├── jackets │ │ ├── browserslist │ │ ├── karma.conf.js │ │ ├── src │ │ │ ├── app │ │ │ │ ├── app.component.css │ │ │ │ ├── app.component.html │ │ │ │ ├── app.component.spec.ts │ │ │ │ ├── app.component.ts │ │ │ │ ├── app.module.ts │ │ │ │ └── jacket-list │ │ │ │ │ ├── jacket-list.component.html │ │ │ │ │ ├── jacket-list.component.scss │ │ │ │ │ ├── jacket-list.component.spec.ts │ │ │ │ │ └── jacket-list.component.ts │ │ │ ├── assets │ │ │ │ └── .gitkeep │ │ │ ├── environments │ │ │ │ ├── environment.prod.ts │ │ │ │ └── environment.ts │ │ │ ├── favicon.ico │ │ │ ├── index.html │ │ │ ├── main.ts │ │ │ ├── polyfills.ts │ │ │ ├── styles.css │ │ │ └── test.ts │ │ ├── tsconfig.app.json │ │ ├── tsconfig.spec.json │ │ └── tslint.json │ └── vendors │ │ ├── karma.conf.js │ │ ├── ng-package.json │ │ ├── package.json │ │ ├── src │ │ ├── lib │ │ │ ├── vendors.component.spec.ts │ │ │ ├── vendors.component.ts │ │ │ ├── vendors.module.ts │ │ │ ├── vendors.service.spec.ts │ │ │ └── vendors.service.ts │ │ ├── projects.ts │ │ └── test.ts │ │ ├── tsconfig.lib.json │ │ ├── tsconfig.spec.json │ │ └── tslint.json │ ├── src │ ├── app │ │ ├── app-routing.module.ts │ │ ├── app.component.html │ │ ├── app.component.scss │ │ ├── app.component.spec.ts │ │ ├── app.component.ts │ │ └── app.module.ts │ ├── assets │ │ └── .gitkeep │ ├── browserslist │ ├── environments │ │ ├── environment.prod.ts │ │ └── environment.ts │ ├── favicon.ico │ ├── index.html │ ├── karma.conf.js │ ├── main.ts │ ├── polyfills.ts │ ├── styles.scss │ ├── test.ts │ ├── tsconfig.app.json │ ├── tsconfig.spec.json │ └── tslint.json │ ├── tsconfig.json │ └── tslint.json ├── LICENSE └── README.md /Chapter01/chapter1_quickstart/.editorconfig: -------------------------------------------------------------------------------- 1 | # Editor configuration, see https://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 | -------------------------------------------------------------------------------- /Chapter01/chapter1_quickstart/e2e/src/app.e2e-spec.ts: -------------------------------------------------------------------------------- 1 | import { AppPage } from './app.po'; 2 | 3 | describe('workspace-project App', () => { 4 | let page: AppPage; 5 | 6 | beforeEach(() => { 7 | page = new AppPage(); 8 | }); 9 | 10 | it('should display welcome message', () => { 11 | page.navigateTo(); 12 | expect(page.getTitleText()).toEqual('Welcome to todolist!'); 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /Chapter01/chapter1_quickstart/e2e/src/app.po.ts: -------------------------------------------------------------------------------- 1 | import { browser, by, element } from 'protractor'; 2 | 3 | export class AppPage { 4 | navigateTo() { 5 | return browser.get('/'); 6 | } 7 | 8 | getTitleText() { 9 | return element(by.css('app-root h1')).getText(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Chapter01/chapter1_quickstart/e2e/tsconfig.e2e.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/app", 5 | "module": "commonjs", 6 | "target": "es5", 7 | "types": [ 8 | "jasmine", 9 | "jasminewd2", 10 | "node" 11 | ] 12 | } 13 | } -------------------------------------------------------------------------------- /Chapter01/chapter1_quickstart/src/app/app-routing.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { Routes, RouterModule } from '@angular/router'; 3 | 4 | const routes: Routes = []; 5 | 6 | @NgModule({ 7 | imports: [RouterModule.forRoot(routes)], 8 | exports: [RouterModule] 9 | }) 10 | export class AppRoutingModule { } 11 | -------------------------------------------------------------------------------- /Chapter01/chapter1_quickstart/src/app/app.component.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /Chapter01/chapter1_quickstart/src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-root', 5 | templateUrl: './app.component.html', 6 | styleUrls: ['./app.component.scss'] 7 | }) 8 | export class AppComponent { 9 | title = 'todolist'; 10 | } 11 | -------------------------------------------------------------------------------- /Chapter01/chapter1_quickstart/src/app/home/home.component.html: -------------------------------------------------------------------------------- 1 |

2 | home works! 3 |

4 | -------------------------------------------------------------------------------- /Chapter01/chapter1_quickstart/src/app/home/home.component.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Angular-and-Bootstrap-Third-Edition/6d52dea530bc0835c7ec648c746aa5826cab48a9/Chapter01/chapter1_quickstart/src/app/home/home.component.scss -------------------------------------------------------------------------------- /Chapter01/chapter1_quickstart/src/app/home/home.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-home', 5 | templateUrl: './home.component.html', 6 | styleUrls: ['./home.component.scss'] 7 | }) 8 | export class HomeComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /Chapter01/chapter1_quickstart/src/app/todolist/todolist.component.html: -------------------------------------------------------------------------------- 1 |

2 | todolist works! 3 |

4 | -------------------------------------------------------------------------------- /Chapter01/chapter1_quickstart/src/app/todolist/todolist.component.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Angular-and-Bootstrap-Third-Edition/6d52dea530bc0835c7ec648c746aa5826cab48a9/Chapter01/chapter1_quickstart/src/app/todolist/todolist.component.scss -------------------------------------------------------------------------------- /Chapter01/chapter1_quickstart/src/app/todolist/todolist.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-todolist', 5 | templateUrl: './todolist.component.html', 6 | styleUrls: ['./todolist.component.scss'] 7 | }) 8 | export class TodolistComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /Chapter01/chapter1_quickstart/src/assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Angular-and-Bootstrap-Third-Edition/6d52dea530bc0835c7ec648c746aa5826cab48a9/Chapter01/chapter1_quickstart/src/assets/.gitkeep -------------------------------------------------------------------------------- /Chapter01/chapter1_quickstart/src/browserslist: -------------------------------------------------------------------------------- 1 | # This file is currently used by autoprefixer to adjust CSS to support the below specified browsers 2 | # For additional information regarding the format and rule options, please see: 3 | # https://github.com/browserslist/browserslist#queries 4 | # 5 | # For IE 9-11 support, please remove 'not' from the last line of the file and adjust as needed 6 | 7 | > 0.5% 8 | last 2 versions 9 | Firefox ESR 10 | not dead 11 | not IE 9-11 -------------------------------------------------------------------------------- /Chapter01/chapter1_quickstart/src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true 3 | }; 4 | -------------------------------------------------------------------------------- /Chapter01/chapter1_quickstart/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Angular-and-Bootstrap-Third-Edition/6d52dea530bc0835c7ec648c746aa5826cab48a9/Chapter01/chapter1_quickstart/src/favicon.ico -------------------------------------------------------------------------------- /Chapter01/chapter1_quickstart/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Todolist 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /Chapter01/chapter1_quickstart/src/main.ts: -------------------------------------------------------------------------------- 1 | import { enableProdMode } from '@angular/core'; 2 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 3 | 4 | import { AppModule } from './app/app.module'; 5 | import { environment } from './environments/environment'; 6 | 7 | if (environment.production) { 8 | enableProdMode(); 9 | } 10 | 11 | platformBrowserDynamic().bootstrapModule(AppModule) 12 | .catch(err => console.error(err)); 13 | -------------------------------------------------------------------------------- /Chapter01/chapter1_quickstart/src/styles.scss: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | -------------------------------------------------------------------------------- /Chapter01/chapter1_quickstart/src/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/app", 5 | "types": [] 6 | }, 7 | "exclude": [ 8 | "test.ts", 9 | "**/*.spec.ts" 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /Chapter01/chapter1_quickstart/src/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/spec", 5 | "types": [ 6 | "jasmine", 7 | "node" 8 | ] 9 | }, 10 | "files": [ 11 | "test.ts", 12 | "polyfills.ts" 13 | ], 14 | "include": [ 15 | "**/*.spec.ts", 16 | "**/*.d.ts" 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /Chapter01/chapter1_quickstart/src/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tslint.json", 3 | "rules": { 4 | "directive-selector": [ 5 | true, 6 | "attribute", 7 | "app", 8 | "camelCase" 9 | ], 10 | "component-selector": [ 11 | true, 12 | "element", 13 | "app", 14 | "kebab-case" 15 | ] 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Chapter02/chapter2_part1/.editorconfig: -------------------------------------------------------------------------------- 1 | # Editor configuration, see https://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 | -------------------------------------------------------------------------------- /Chapter02/chapter2_part1/e2e/src/app.e2e-spec.ts: -------------------------------------------------------------------------------- 1 | import { AppPage } from './app.po'; 2 | 3 | describe('workspace-project App', () => { 4 | let page: AppPage; 5 | 6 | beforeEach(() => { 7 | page = new AppPage(); 8 | }); 9 | 10 | it('should display welcome message', () => { 11 | page.navigateTo(); 12 | expect(page.getTitleText()).toEqual('Welcome to LearningTypeScript!'); 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /Chapter02/chapter2_part1/e2e/src/app.po.ts: -------------------------------------------------------------------------------- 1 | import { browser, by, element } from 'protractor'; 2 | 3 | export class AppPage { 4 | navigateTo() { 5 | return browser.get('/'); 6 | } 7 | 8 | getTitleText() { 9 | return element(by.css('app-root h1')).getText(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Chapter02/chapter2_part1/e2e/tsconfig.e2e.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/app", 5 | "module": "commonjs", 6 | "target": "es5", 7 | "types": [ 8 | "jasmine", 9 | "jasminewd2", 10 | "node" 11 | ] 12 | } 13 | } -------------------------------------------------------------------------------- /Chapter02/chapter2_part1/src/app/app.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Angular-and-Bootstrap-Third-Edition/6d52dea530bc0835c7ec648c746aa5826cab48a9/Chapter02/chapter2_part1/src/app/app.component.css -------------------------------------------------------------------------------- /Chapter02/chapter2_part1/src/app/app.module.ts: -------------------------------------------------------------------------------- 1 | import { BrowserModule } from '@angular/platform-browser'; 2 | import { NgModule } from '@angular/core'; 3 | 4 | import { AppComponent } from './app.component'; 5 | 6 | @NgModule({ 7 | declarations: [ 8 | AppComponent 9 | ], 10 | imports: [ 11 | BrowserModule 12 | ], 13 | providers: [], 14 | bootstrap: [AppComponent] 15 | }) 16 | export class AppModule { } 17 | -------------------------------------------------------------------------------- /Chapter02/chapter2_part1/src/assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Angular-and-Bootstrap-Third-Edition/6d52dea530bc0835c7ec648c746aa5826cab48a9/Chapter02/chapter2_part1/src/assets/.gitkeep -------------------------------------------------------------------------------- /Chapter02/chapter2_part1/src/browserslist: -------------------------------------------------------------------------------- 1 | # This file is currently used by autoprefixer to adjust CSS to support the below specified browsers 2 | # For additional information regarding the format and rule options, please see: 3 | # https://github.com/browserslist/browserslist#queries 4 | # 5 | # For IE 9-11 support, please remove 'not' from the last line of the file and adjust as needed 6 | 7 | > 0.5% 8 | last 2 versions 9 | Firefox ESR 10 | not dead 11 | not IE 9-11 -------------------------------------------------------------------------------- /Chapter02/chapter2_part1/src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true 3 | }; 4 | -------------------------------------------------------------------------------- /Chapter02/chapter2_part1/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Angular-and-Bootstrap-Third-Edition/6d52dea530bc0835c7ec648c746aa5826cab48a9/Chapter02/chapter2_part1/src/favicon.ico -------------------------------------------------------------------------------- /Chapter02/chapter2_part1/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | LearningTypeScript 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /Chapter02/chapter2_part1/src/main.ts: -------------------------------------------------------------------------------- 1 | import { enableProdMode } from '@angular/core'; 2 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 3 | 4 | import { AppModule } from './app/app.module'; 5 | import { environment } from './environments/environment'; 6 | 7 | if (environment.production) { 8 | enableProdMode(); 9 | } 10 | 11 | platformBrowserDynamic().bootstrapModule(AppModule) 12 | .catch(err => console.error(err)); 13 | -------------------------------------------------------------------------------- /Chapter02/chapter2_part1/src/styles.css: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | -------------------------------------------------------------------------------- /Chapter02/chapter2_part1/src/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/app", 5 | "types": [] 6 | }, 7 | "exclude": [ 8 | "test.ts", 9 | "**/*.spec.ts" 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /Chapter02/chapter2_part1/src/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/spec", 5 | "types": [ 6 | "jasmine", 7 | "node" 8 | ] 9 | }, 10 | "files": [ 11 | "test.ts", 12 | "polyfills.ts" 13 | ], 14 | "include": [ 15 | "**/*.spec.ts", 16 | "**/*.d.ts" 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /Chapter02/chapter2_part1/src/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tslint.json", 3 | "rules": { 4 | "directive-selector": [ 5 | true, 6 | "attribute", 7 | "app", 8 | "camelCase" 9 | ], 10 | "component-selector": [ 11 | true, 12 | "element", 13 | "app", 14 | "kebab-case" 15 | ] 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Chapter02/chapter2_part2/alphafunctions.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | exports.__esModule = true; 3 | function alpha1() { 4 | console.log("Alpha 1 was called"); 5 | } 6 | exports.alpha1 = alpha1; 7 | function alpha2() { 8 | console.log("Alpha 2 was called"); 9 | } 10 | exports.alpha2 = alpha2; 11 | -------------------------------------------------------------------------------- /Chapter02/chapter2_part2/alphafunctions.ts: -------------------------------------------------------------------------------- 1 | function alpha1() { 2 | console.log("Alpha 1 was called"); 3 | } 4 | function alpha2() { 5 | console.log("Alpha 2 was called"); 6 | } 7 | export {alpha1, alpha2}; -------------------------------------------------------------------------------- /Chapter02/chapter2_part2/cars.ts: -------------------------------------------------------------------------------- 1 | class Car { 2 | make : string; 3 | model : string; 4 | speed: number = 10; 5 | constructor(make : string, model:string) { 6 | this.make = make; 7 | this.model = model; 8 | } 9 | 10 | getSpeed() 11 | { 12 | return this.speed; 13 | } 14 | 15 | speedUp() { 16 | this.speed += 10; 17 | } 18 | slowDown() { 19 | this.speed -= 10; 20 | } 21 | } 22 | let car = new Car("2019", 'BMW Sports'); 23 | 24 | console.log(car.getSpeed()); 25 | 26 | -------------------------------------------------------------------------------- /Chapter02/chapter2_part2/decorator.ts: -------------------------------------------------------------------------------- 1 | function iq(target) { 2 | Object.defineProperty(target.prototype, 'iq', {value: () => "Genius"}) 3 | } 4 | @iq 5 | class Person { 6 | } 7 | let readerOfMyBook = new Person(); 8 | console.log(readerOfMyBook.iq()); // prints out "Genius" to the console -------------------------------------------------------------------------------- /Chapter02/chapter2_part2/destruction.js: -------------------------------------------------------------------------------- 1 | var author = { 2 | firstName: 'Aki', 3 | lastName: 'Iskandar', 4 | topics: ['Angular', 'JavaScript', 'TypeScript', 'Bootstrap', 'Node'], 5 | cities: ['Calgary', 'Cleveland'], 6 | publisher: 'Packt' 7 | }; 8 | var fName = author.firstName; 9 | var lName = author.lastName; 10 | var pubName = author.publisher; 11 | console.log(pubName); 12 | var firstName = author.firstName, lastName = author.lastName, publisher = author.publisher; 13 | console.log(firstName); 14 | -------------------------------------------------------------------------------- /Chapter02/chapter2_part2/destruction.ts: -------------------------------------------------------------------------------- 1 | const author = { 2 | firstName: 'Aki', 3 | lastName: 'Iskandar', 4 | topics: ['Angular', 'JavaScript', 'TypeScript', 'Bootstrap', 'Node'], 5 | cities: ['Calgary', 'Cleveland'], 6 | publisher: 'Packt' 7 | } 8 | 9 | const fName = author.firstName; 10 | const lName = author.lastName; 11 | const pubName = author.publisher; 12 | 13 | console.log(pubName); 14 | 15 | const {firstName, lastName, publisher} = author; 16 | 17 | console.log(firstName); -------------------------------------------------------------------------------- /Chapter02/chapter2_part2/forLoop.js: -------------------------------------------------------------------------------- 1 | var myArray = [5, 10, 15, 20, 25]; 2 | for (var _i = 0, myArray_1 = myArray; _i < myArray_1.length; _i++) { 3 | var item = myArray_1[_i]; 4 | console.log(item); 5 | } 6 | -------------------------------------------------------------------------------- /Chapter02/chapter2_part2/forLoop.ts: -------------------------------------------------------------------------------- 1 | let myArray = [5, 10, 15, 20, 25]; 2 | for (var item of myArray) { 3 | console.log(item); 4 | } -------------------------------------------------------------------------------- /Chapter02/chapter2_part2/interfaces.ts: -------------------------------------------------------------------------------- 1 | /* Example #2 - Interfaces */ 2 | class Animal implements Species { 3 | } 4 | interface Species { 5 | name: string; 6 | isExtinct: boolean; 7 | } 8 | -------------------------------------------------------------------------------- /Chapter02/chapter2_part2/main.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | exports.__esModule = true; 3 | var alphafunctions_1 = require("./alphafunctions"); 4 | alphafunctions_1.alpha1(); // "Alpha 1 was called" is written to the console 5 | -------------------------------------------------------------------------------- /Chapter02/chapter2_part2/main.ts: -------------------------------------------------------------------------------- 1 | import {alpha1, alpha2} from './alphafunctions'; 2 | alpha1(); // "Alpha 1 was called" is written to the console -------------------------------------------------------------------------------- /Chapter02/chapter2_part2/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "examples", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "keywords": [], 10 | "author": "", 11 | "license": "ISC" 12 | } 13 | -------------------------------------------------------------------------------- /Chapter04/chapter4_routing/.editorconfig: -------------------------------------------------------------------------------- 1 | # Editor configuration, see https://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 | -------------------------------------------------------------------------------- /Chapter04/chapter4_routing/e2e/src/app.po.ts: -------------------------------------------------------------------------------- 1 | import { browser, by, element } from 'protractor'; 2 | 3 | export class AppPage { 4 | navigateTo() { 5 | return browser.get('/'); 6 | } 7 | 8 | getTitleText() { 9 | return element(by.css('app-root h1')).getText(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Chapter04/chapter4_routing/e2e/tsconfig.e2e.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/app", 5 | "module": "commonjs", 6 | "target": "es5", 7 | "types": [ 8 | "jasmine", 9 | "jasminewd2", 10 | "node" 11 | ] 12 | } 13 | } -------------------------------------------------------------------------------- /Chapter04/chapter4_routing/src/app/activate-admin.guard.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed, async, inject } from '@angular/core/testing'; 2 | 3 | import { ActivateAdminGuard } from './activate-admin.guard'; 4 | 5 | describe('ActivateAdminGuard', () => { 6 | beforeEach(() => { 7 | TestBed.configureTestingModule({ 8 | providers: [ActivateAdminGuard] 9 | }); 10 | }); 11 | 12 | it('should ...', inject([ActivateAdminGuard], (guard: ActivateAdminGuard) => { 13 | expect(guard).toBeTruthy(); 14 | })); 15 | }); 16 | -------------------------------------------------------------------------------- /Chapter04/chapter4_routing/src/app/activate-admin.guard.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | import { CanActivate, ActivatedRouteSnapshot, RouterStateSnapshot } from '@angular/router'; 3 | import { Observable } from 'rxjs'; 4 | 5 | @Injectable({ 6 | providedIn: 'root' 7 | }) 8 | export class ActivateAdminGuard implements CanActivate { 9 | canActivate( 10 | next: ActivatedRouteSnapshot, 11 | state: RouterStateSnapshot): Observable | Promise | boolean { 12 | return true; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Chapter04/chapter4_routing/src/app/app.component.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 10 | 11 | -------------------------------------------------------------------------------- /Chapter04/chapter4_routing/src/app/app.component.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Angular-and-Bootstrap-Third-Edition/6d52dea530bc0835c7ec648c746aa5826cab48a9/Chapter04/chapter4_routing/src/app/app.component.scss -------------------------------------------------------------------------------- /Chapter04/chapter4_routing/src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-root', 5 | templateUrl: './app.component.html', 6 | styleUrls: ['./app.component.scss'] 7 | }) 8 | export class AppComponent { 9 | title = 'realtycarousel'; 10 | 11 | categories = [ 12 | {categoryName:'New York', categoryId: '1'}, 13 | {categoryName:'Dallas', categoryId: '2'}, 14 | {categoryName:'California', categoryId: '3'} 15 | ]; 16 | 17 | } -------------------------------------------------------------------------------- /Chapter04/chapter4_routing/src/app/crud/crud.component.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Angular-and-Bootstrap-Third-Edition/6d52dea530bc0835c7ec648c746aa5826cab48a9/Chapter04/chapter4_routing/src/app/crud/crud.component.scss -------------------------------------------------------------------------------- /Chapter04/chapter4_routing/src/app/crud/crud.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-crud', 5 | templateUrl: './crud.component.html', 6 | styleUrls: ['./crud.component.scss'] 7 | }) 8 | export class CrudComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /Chapter04/chapter4_routing/src/app/home/home.component.html: -------------------------------------------------------------------------------- 1 |

2 | home works! 3 |

4 | -------------------------------------------------------------------------------- /Chapter04/chapter4_routing/src/app/home/home.component.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Angular-and-Bootstrap-Third-Edition/6d52dea530bc0835c7ec648c746aa5826cab48a9/Chapter04/chapter4_routing/src/app/home/home.component.scss -------------------------------------------------------------------------------- /Chapter04/chapter4_routing/src/app/home/home.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-home', 5 | templateUrl: './home.component.html', 6 | styleUrls: ['./home.component.scss'] 7 | }) 8 | export class HomeComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /Chapter04/chapter4_routing/src/app/listing-details/listing-details.component.html: -------------------------------------------------------------------------------- 1 |

2 | listing-details works! 3 |

4 | -------------------------------------------------------------------------------- /Chapter04/chapter4_routing/src/app/listing-details/listing-details.component.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Angular-and-Bootstrap-Third-Edition/6d52dea530bc0835c7ec648c746aa5826cab48a9/Chapter04/chapter4_routing/src/app/listing-details/listing-details.component.scss -------------------------------------------------------------------------------- /Chapter04/chapter4_routing/src/app/listings/listings.component.html: -------------------------------------------------------------------------------- 1 |

2 | listings works! 3 |

4 | -------------------------------------------------------------------------------- /Chapter04/chapter4_routing/src/app/listings/listings.component.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Angular-and-Bootstrap-Third-Edition/6d52dea530bc0835c7ec648c746aa5826cab48a9/Chapter04/chapter4_routing/src/app/listings/listings.component.scss -------------------------------------------------------------------------------- /Chapter04/chapter4_routing/src/app/listings/listings.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-listings', 5 | templateUrl: './listings.component.html', 6 | styleUrls: ['./listings.component.scss'] 7 | }) 8 | export class ListingsComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /Chapter04/chapter4_routing/src/app/menu/menu.component.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Angular-and-Bootstrap-Third-Edition/6d52dea530bc0835c7ec648c746aa5826cab48a9/Chapter04/chapter4_routing/src/app/menu/menu.component.scss -------------------------------------------------------------------------------- /Chapter04/chapter4_routing/src/app/menu/menu.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-menu', 5 | templateUrl: './menu.component.html', 6 | styleUrls: ['./menu.component.scss'] 7 | }) 8 | export class MenuComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /Chapter04/chapter4_routing/src/assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Angular-and-Bootstrap-Third-Edition/6d52dea530bc0835c7ec648c746aa5826cab48a9/Chapter04/chapter4_routing/src/assets/.gitkeep -------------------------------------------------------------------------------- /Chapter04/chapter4_routing/src/browserslist: -------------------------------------------------------------------------------- 1 | # This file is currently used by autoprefixer to adjust CSS to support the below specified browsers 2 | # For additional information regarding the format and rule options, please see: 3 | # https://github.com/browserslist/browserslist#queries 4 | # 5 | # For IE 9-11 support, please remove 'not' from the last line of the file and adjust as needed 6 | 7 | > 0.5% 8 | last 2 versions 9 | Firefox ESR 10 | not dead 11 | not IE 9-11 -------------------------------------------------------------------------------- /Chapter04/chapter4_routing/src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true 3 | }; 4 | -------------------------------------------------------------------------------- /Chapter04/chapter4_routing/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Angular-and-Bootstrap-Third-Edition/6d52dea530bc0835c7ec648c746aa5826cab48a9/Chapter04/chapter4_routing/src/favicon.ico -------------------------------------------------------------------------------- /Chapter04/chapter4_routing/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Realtycarousel 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /Chapter04/chapter4_routing/src/main.ts: -------------------------------------------------------------------------------- 1 | import { enableProdMode } from '@angular/core'; 2 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 3 | 4 | import { AppModule } from './app/app.module'; 5 | import { environment } from './environments/environment'; 6 | 7 | if (environment.production) { 8 | enableProdMode(); 9 | } 10 | 11 | platformBrowserDynamic().bootstrapModule(AppModule) 12 | .catch(err => console.error(err)); 13 | -------------------------------------------------------------------------------- /Chapter04/chapter4_routing/src/styles.scss: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | -------------------------------------------------------------------------------- /Chapter04/chapter4_routing/src/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/app", 5 | "types": [] 6 | }, 7 | "exclude": [ 8 | "test.ts", 9 | "**/*.spec.ts" 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /Chapter04/chapter4_routing/src/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/spec", 5 | "types": [ 6 | "jasmine", 7 | "node" 8 | ] 9 | }, 10 | "files": [ 11 | "test.ts", 12 | "polyfills.ts" 13 | ], 14 | "include": [ 15 | "**/*.spec.ts", 16 | "**/*.d.ts" 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /Chapter04/chapter4_routing/src/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tslint.json", 3 | "rules": { 4 | "directive-selector": [ 5 | true, 6 | "attribute", 7 | "app", 8 | "camelCase" 9 | ], 10 | "component-selector": [ 11 | true, 12 | "element", 13 | "app", 14 | "kebab-case" 15 | ] 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Chapter05/chapter5-flex/.editorconfig: -------------------------------------------------------------------------------- 1 | # Editor configuration, see https://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 | -------------------------------------------------------------------------------- /Chapter05/chapter5-flex/e2e/src/app.e2e-spec.ts: -------------------------------------------------------------------------------- 1 | import { AppPage } from './app.po'; 2 | 3 | describe('workspace-project App', () => { 4 | let page: AppPage; 5 | 6 | beforeEach(() => { 7 | page = new AppPage(); 8 | }); 9 | 10 | it('should display welcome message', () => { 11 | page.navigateTo(); 12 | expect(page.getTitleText()).toEqual('Welcome to flexLayout!'); 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /Chapter05/chapter5-flex/e2e/src/app.po.ts: -------------------------------------------------------------------------------- 1 | import { browser, by, element } from 'protractor'; 2 | 3 | export class AppPage { 4 | navigateTo() { 5 | return browser.get('/'); 6 | } 7 | 8 | getTitleText() { 9 | return element(by.css('app-root h1')).getText(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Chapter05/chapter5-flex/e2e/tsconfig.e2e.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/app", 5 | "module": "commonjs", 6 | "target": "es5", 7 | "types": [ 8 | "jasmine", 9 | "jasminewd2", 10 | "node" 11 | ] 12 | } 13 | } -------------------------------------------------------------------------------- /Chapter05/chapter5-flex/src/app/app.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Angular-and-Bootstrap-Third-Edition/6d52dea530bc0835c7ec648c746aa5826cab48a9/Chapter05/chapter5-flex/src/app/app.component.css -------------------------------------------------------------------------------- /Chapter05/chapter5-flex/src/app/app.component.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /Chapter05/chapter5-flex/src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-root', 5 | templateUrl: './app.component.html', 6 | styleUrls: ['./app.component.css'] 7 | }) 8 | export class AppComponent { 9 | title = 'flexLayout'; 10 | } 11 | -------------------------------------------------------------------------------- /Chapter05/chapter5-flex/src/app/create-listing/create-listing.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-create-listing', 5 | templateUrl: './create-listing.component.html', 6 | styleUrls: ['./create-listing.component.css'] 7 | }) 8 | export class CreateListingComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /Chapter05/chapter5-flex/src/app/edit-listing/edit-listing.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Angular-and-Bootstrap-Third-Edition/6d52dea530bc0835c7ec648c746aa5826cab48a9/Chapter05/chapter5-flex/src/app/edit-listing/edit-listing.component.css -------------------------------------------------------------------------------- /Chapter05/chapter5-flex/src/app/edit-listing/edit-listing.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-edit-listing', 5 | templateUrl: './edit-listing.component.html', 6 | styleUrls: ['./edit-listing.component.css'] 7 | }) 8 | export class EditListingComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /Chapter05/chapter5-flex/src/assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Angular-and-Bootstrap-Third-Edition/6d52dea530bc0835c7ec648c746aa5826cab48a9/Chapter05/chapter5-flex/src/assets/.gitkeep -------------------------------------------------------------------------------- /Chapter05/chapter5-flex/src/browserslist: -------------------------------------------------------------------------------- 1 | # This file is currently used by autoprefixer to adjust CSS to support the below specified browsers 2 | # For additional information regarding the format and rule options, please see: 3 | # https://github.com/browserslist/browserslist#queries 4 | # 5 | # For IE 9-11 support, please remove 'not' from the last line of the file and adjust as needed 6 | 7 | > 0.5% 8 | last 2 versions 9 | Firefox ESR 10 | not dead 11 | not IE 9-11 -------------------------------------------------------------------------------- /Chapter05/chapter5-flex/src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true 3 | }; 4 | -------------------------------------------------------------------------------- /Chapter05/chapter5-flex/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Angular-and-Bootstrap-Third-Edition/6d52dea530bc0835c7ec648c746aa5826cab48a9/Chapter05/chapter5-flex/src/favicon.ico -------------------------------------------------------------------------------- /Chapter05/chapter5-flex/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | FlexLayout 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /Chapter05/chapter5-flex/src/main.ts: -------------------------------------------------------------------------------- 1 | import { enableProdMode } from '@angular/core'; 2 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 3 | 4 | import { AppModule } from './app/app.module'; 5 | import { environment } from './environments/environment'; 6 | 7 | if (environment.production) { 8 | enableProdMode(); 9 | } 10 | 11 | platformBrowserDynamic().bootstrapModule(AppModule) 12 | .catch(err => console.error(err)); 13 | -------------------------------------------------------------------------------- /Chapter05/chapter5-flex/src/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/app", 5 | "types": [] 6 | }, 7 | "exclude": [ 8 | "test.ts", 9 | "**/*.spec.ts" 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /Chapter05/chapter5-flex/src/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/spec", 5 | "types": [ 6 | "jasmine", 7 | "node" 8 | ] 9 | }, 10 | "files": [ 11 | "test.ts", 12 | "polyfills.ts" 13 | ], 14 | "include": [ 15 | "**/*.spec.ts", 16 | "**/*.d.ts" 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /Chapter05/chapter5-flex/src/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tslint.json", 3 | "rules": { 4 | "directive-selector": [ 5 | true, 6 | "attribute", 7 | "app", 8 | "camelCase" 9 | ], 10 | "component-selector": [ 11 | true, 12 | "element", 13 | "app", 14 | "kebab-case" 15 | ] 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Chapter05/chapter5_flex/.editorconfig: -------------------------------------------------------------------------------- 1 | # Editor configuration, see https://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 | -------------------------------------------------------------------------------- /Chapter05/chapter5_flex/e2e/src/app.e2e-spec.ts: -------------------------------------------------------------------------------- 1 | import { AppPage } from './app.po'; 2 | 3 | describe('workspace-project App', () => { 4 | let page: AppPage; 5 | 6 | beforeEach(() => { 7 | page = new AppPage(); 8 | }); 9 | 10 | it('should display welcome message', () => { 11 | page.navigateTo(); 12 | expect(page.getTitleText()).toEqual('Welcome to flexLayout!'); 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /Chapter05/chapter5_flex/e2e/src/app.po.ts: -------------------------------------------------------------------------------- 1 | import { browser, by, element } from 'protractor'; 2 | 3 | export class AppPage { 4 | navigateTo() { 5 | return browser.get('/'); 6 | } 7 | 8 | getTitleText() { 9 | return element(by.css('app-root h1')).getText(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Chapter05/chapter5_flex/e2e/tsconfig.e2e.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/app", 5 | "module": "commonjs", 6 | "target": "es5", 7 | "types": [ 8 | "jasmine", 9 | "jasminewd2", 10 | "node" 11 | ] 12 | } 13 | } -------------------------------------------------------------------------------- /Chapter05/chapter5_flex/src/app/app.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Angular-and-Bootstrap-Third-Edition/6d52dea530bc0835c7ec648c746aa5826cab48a9/Chapter05/chapter5_flex/src/app/app.component.css -------------------------------------------------------------------------------- /Chapter05/chapter5_flex/src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-root', 5 | templateUrl: './app.component.html', 6 | styleUrls: ['./app.component.css'] 7 | }) 8 | export class AppComponent { 9 | title = 'flexLayout'; 10 | } 11 | -------------------------------------------------------------------------------- /Chapter05/chapter5_flex/src/app/app.module.ts: -------------------------------------------------------------------------------- 1 | import { BrowserModule } from '@angular/platform-browser'; 2 | import { NgModule } from '@angular/core'; 3 | 4 | import { AppComponent } from './app.component'; 5 | import { FlexLayoutModule } from '@angular/flex-layout'; 6 | 7 | @NgModule({ 8 | declarations: [ 9 | AppComponent 10 | ], 11 | imports: [ 12 | BrowserModule, 13 | FlexLayoutModule 14 | ], 15 | providers: [], 16 | bootstrap: [AppComponent] 17 | }) 18 | export class AppModule { } 19 | -------------------------------------------------------------------------------- /Chapter05/chapter5_flex/src/assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Angular-and-Bootstrap-Third-Edition/6d52dea530bc0835c7ec648c746aa5826cab48a9/Chapter05/chapter5_flex/src/assets/.gitkeep -------------------------------------------------------------------------------- /Chapter05/chapter5_flex/src/browserslist: -------------------------------------------------------------------------------- 1 | # This file is currently used by autoprefixer to adjust CSS to support the below specified browsers 2 | # For additional information regarding the format and rule options, please see: 3 | # https://github.com/browserslist/browserslist#queries 4 | # 5 | # For IE 9-11 support, please remove 'not' from the last line of the file and adjust as needed 6 | 7 | > 0.5% 8 | last 2 versions 9 | Firefox ESR 10 | not dead 11 | not IE 9-11 -------------------------------------------------------------------------------- /Chapter05/chapter5_flex/src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true 3 | }; 4 | -------------------------------------------------------------------------------- /Chapter05/chapter5_flex/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Angular-and-Bootstrap-Third-Edition/6d52dea530bc0835c7ec648c746aa5826cab48a9/Chapter05/chapter5_flex/src/favicon.ico -------------------------------------------------------------------------------- /Chapter05/chapter5_flex/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | FlexLayout 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /Chapter05/chapter5_flex/src/main.ts: -------------------------------------------------------------------------------- 1 | import { enableProdMode } from '@angular/core'; 2 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 3 | 4 | import { AppModule } from './app/app.module'; 5 | import { environment } from './environments/environment'; 6 | 7 | if (environment.production) { 8 | enableProdMode(); 9 | } 10 | 11 | platformBrowserDynamic().bootstrapModule(AppModule) 12 | .catch(err => console.error(err)); 13 | -------------------------------------------------------------------------------- /Chapter05/chapter5_flex/src/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/app", 5 | "types": [] 6 | }, 7 | "exclude": [ 8 | "test.ts", 9 | "**/*.spec.ts" 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /Chapter05/chapter5_flex/src/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/spec", 5 | "types": [ 6 | "jasmine", 7 | "node" 8 | ] 9 | }, 10 | "files": [ 11 | "test.ts", 12 | "polyfills.ts" 13 | ], 14 | "include": [ 15 | "**/*.spec.ts", 16 | "**/*.d.ts" 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /Chapter05/chapter5_flex/src/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tslint.json", 3 | "rules": { 4 | "directive-selector": [ 5 | true, 6 | "attribute", 7 | "app", 8 | "camelCase" 9 | ], 10 | "component-selector": [ 11 | true, 12 | "element", 13 | "app", 14 | "kebab-case" 15 | ] 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Chapter06/chapter6_angularComponents/.editorconfig: -------------------------------------------------------------------------------- 1 | # Editor configuration, see https://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 | -------------------------------------------------------------------------------- /Chapter06/chapter6_angularComponents/e2e/src/app.e2e-spec.ts: -------------------------------------------------------------------------------- 1 | import { AppPage } from './app.po'; 2 | 3 | describe('workspace-project App', () => { 4 | let page: AppPage; 5 | 6 | beforeEach(() => { 7 | page = new AppPage(); 8 | }); 9 | 10 | it('should display welcome message', () => { 11 | page.navigateTo(); 12 | expect(page.getTitleText()).toEqual('Welcome to LearningComponents!'); 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /Chapter06/chapter6_angularComponents/e2e/src/app.po.ts: -------------------------------------------------------------------------------- 1 | import { browser, by, element } from 'protractor'; 2 | 3 | export class AppPage { 4 | navigateTo() { 5 | return browser.get('/'); 6 | } 7 | 8 | getTitleText() { 9 | return element(by.css('app-root h1')).getText(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Chapter06/chapter6_angularComponents/e2e/tsconfig.e2e.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/app", 5 | "module": "commonjs", 6 | "target": "es5", 7 | "types": [ 8 | "jasmine", 9 | "jasminewd2", 10 | "node" 11 | ] 12 | } 13 | } -------------------------------------------------------------------------------- /Chapter06/chapter6_angularComponents/src/app/app-routing.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { Routes, RouterModule } from '@angular/router'; 3 | 4 | const routes: Routes = []; 5 | 6 | @NgModule({ 7 | imports: [RouterModule.forRoot(routes)], 8 | exports: [RouterModule] 9 | }) 10 | export class AppRoutingModule { } 11 | -------------------------------------------------------------------------------- /Chapter06/chapter6_angularComponents/src/app/app.component.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /Chapter06/chapter6_angularComponents/src/app/app.component.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Angular-and-Bootstrap-Third-Edition/6d52dea530bc0835c7ec648c746aa5826cab48a9/Chapter06/chapter6_angularComponents/src/app/app.component.scss -------------------------------------------------------------------------------- /Chapter06/chapter6_angularComponents/src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-root', 5 | templateUrl: './app.component.html', 6 | styleUrls: ['./app.component.scss'] 7 | }) 8 | export class AppComponent { 9 | title = 'LearningComponents'; 10 | } 11 | -------------------------------------------------------------------------------- /Chapter06/chapter6_angularComponents/src/app/car/car.component.html: -------------------------------------------------------------------------------- 1 |

2 | car works! 3 |

4 | -------------------------------------------------------------------------------- /Chapter06/chapter6_angularComponents/src/app/car/car.component.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Angular-and-Bootstrap-Third-Edition/6d52dea530bc0835c7ec648c746aa5826cab48a9/Chapter06/chapter6_angularComponents/src/app/car/car.component.scss -------------------------------------------------------------------------------- /Chapter06/chapter6_angularComponents/src/app/car/car.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-car', 5 | templateUrl: './car.component.html', 6 | styleUrls: ['./car.component.scss'] 7 | }) 8 | export class CarComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | console.log('An instance of our CarComponent has been fully initialized.'); 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /Chapter06/chapter6_angularComponents/src/app/dad/dad.component.html: -------------------------------------------------------------------------------- 1 |

2 | dad works! 3 |

4 | -------------------------------------------------------------------------------- /Chapter06/chapter6_angularComponents/src/app/dad/dad.component.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Angular-and-Bootstrap-Third-Edition/6d52dea530bc0835c7ec648c746aa5826cab48a9/Chapter06/chapter6_angularComponents/src/app/dad/dad.component.scss -------------------------------------------------------------------------------- /Chapter06/chapter6_angularComponents/src/app/dad/dad.component.ts: -------------------------------------------------------------------------------- 1 | import {Component } from '@angular/core'; 2 | @Component({ 3 | selector: 'app-dad', 4 | template: `

Hello. {{message}}.


5 | 7 | 8 | `, 9 | }) 10 | export class DadComponent { 11 | message = 'I\'m a Dad'; 12 | arrSonNames = ['Justin', 'Haley', 'Brendan']; 13 | } -------------------------------------------------------------------------------- /Chapter06/chapter6_angularComponents/src/app/photo-listing/photo-listing.component.html: -------------------------------------------------------------------------------- 1 |

2 | photo-listing works! 3 |

4 | -------------------------------------------------------------------------------- /Chapter06/chapter6_angularComponents/src/app/photo-listing/photo-listing.component.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Angular-and-Bootstrap-Third-Edition/6d52dea530bc0835c7ec648c746aa5826cab48a9/Chapter06/chapter6_angularComponents/src/app/photo-listing/photo-listing.component.scss -------------------------------------------------------------------------------- /Chapter06/chapter6_angularComponents/src/app/photo-listing/photo-listing.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-photo-listing', 5 | templateUrl: './photo-listing.component.html', 6 | styleUrls: ['./photo-listing.component.scss'] 7 | }) 8 | export class PhotoListingComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /Chapter06/chapter6_angularComponents/src/app/preview-listing/preview-listing.component.html: -------------------------------------------------------------------------------- 1 |

2 | preview-listing works! 3 |

4 | -------------------------------------------------------------------------------- /Chapter06/chapter6_angularComponents/src/app/preview-listing/preview-listing.component.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Angular-and-Bootstrap-Third-Edition/6d52dea530bc0835c7ec648c746aa5826cab48a9/Chapter06/chapter6_angularComponents/src/app/preview-listing/preview-listing.component.scss -------------------------------------------------------------------------------- /Chapter06/chapter6_angularComponents/src/app/preview-listing/preview-listing.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-preview-listing', 5 | templateUrl: './preview-listing.component.html', 6 | styleUrls: ['./preview-listing.component.scss'] 7 | }) 8 | export class PreviewListingComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /Chapter06/chapter6_angularComponents/src/app/preview-photos/preview-photos.component.html: -------------------------------------------------------------------------------- 1 |

2 | preview-photos works! 3 |

4 | -------------------------------------------------------------------------------- /Chapter06/chapter6_angularComponents/src/app/preview-photos/preview-photos.component.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Angular-and-Bootstrap-Third-Edition/6d52dea530bc0835c7ec648c746aa5826cab48a9/Chapter06/chapter6_angularComponents/src/app/preview-photos/preview-photos.component.scss -------------------------------------------------------------------------------- /Chapter06/chapter6_angularComponents/src/app/preview-photos/preview-photos.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-preview-photos', 5 | templateUrl: './preview-photos.component.html', 6 | styleUrls: ['./preview-photos.component.scss'] 7 | }) 8 | export class PreviewPhotosComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /Chapter06/chapter6_angularComponents/src/assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Angular-and-Bootstrap-Third-Edition/6d52dea530bc0835c7ec648c746aa5826cab48a9/Chapter06/chapter6_angularComponents/src/assets/.gitkeep -------------------------------------------------------------------------------- /Chapter06/chapter6_angularComponents/src/browserslist: -------------------------------------------------------------------------------- 1 | # This file is currently used by autoprefixer to adjust CSS to support the below specified browsers 2 | # For additional information regarding the format and rule options, please see: 3 | # https://github.com/browserslist/browserslist#queries 4 | # 5 | # For IE 9-11 support, please remove 'not' from the last line of the file and adjust as needed 6 | 7 | > 0.5% 8 | last 2 versions 9 | Firefox ESR 10 | not dead 11 | not IE 9-11 -------------------------------------------------------------------------------- /Chapter06/chapter6_angularComponents/src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true 3 | }; 4 | -------------------------------------------------------------------------------- /Chapter06/chapter6_angularComponents/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Angular-and-Bootstrap-Third-Edition/6d52dea530bc0835c7ec648c746aa5826cab48a9/Chapter06/chapter6_angularComponents/src/favicon.ico -------------------------------------------------------------------------------- /Chapter06/chapter6_angularComponents/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | LearningComponents 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /Chapter06/chapter6_angularComponents/src/main.ts: -------------------------------------------------------------------------------- 1 | import { enableProdMode } from '@angular/core'; 2 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 3 | 4 | import { AppModule } from './app/app.module'; 5 | import { environment } from './environments/environment'; 6 | 7 | if (environment.production) { 8 | enableProdMode(); 9 | } 10 | 11 | platformBrowserDynamic().bootstrapModule(AppModule) 12 | .catch(err => console.error(err)); 13 | -------------------------------------------------------------------------------- /Chapter06/chapter6_angularComponents/src/styles.scss: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | -------------------------------------------------------------------------------- /Chapter06/chapter6_angularComponents/src/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/app", 5 | "types": [] 6 | }, 7 | "exclude": [ 8 | "test.ts", 9 | "**/*.spec.ts" 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /Chapter06/chapter6_angularComponents/src/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/spec", 5 | "types": [ 6 | "jasmine", 7 | "node" 8 | ] 9 | }, 10 | "files": [ 11 | "test.ts", 12 | "polyfills.ts" 13 | ], 14 | "include": [ 15 | "**/*.spec.ts", 16 | "**/*.d.ts" 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /Chapter06/chapter6_angularComponents/src/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tslint.json", 3 | "rules": { 4 | "directive-selector": [ 5 | true, 6 | "attribute", 7 | "app", 8 | "camelCase" 9 | ], 10 | "component-selector": [ 11 | true, 12 | "element", 13 | "app", 14 | "kebab-case" 15 | ] 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Chapter07/chapter7_templates/.editorconfig: -------------------------------------------------------------------------------- 1 | # Editor configuration, see https://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 | -------------------------------------------------------------------------------- /Chapter07/chapter7_templates/e2e/src/app.e2e-spec.ts: -------------------------------------------------------------------------------- 1 | import { AppPage } from './app.po'; 2 | 3 | describe('workspace-project App', () => { 4 | let page: AppPage; 5 | 6 | beforeEach(() => { 7 | page = new AppPage(); 8 | }); 9 | 10 | it('should display welcome message', () => { 11 | page.navigateTo(); 12 | expect(page.getTitleText()).toEqual('Welcome to AngularTemplates!'); 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /Chapter07/chapter7_templates/e2e/src/app.po.ts: -------------------------------------------------------------------------------- 1 | import { browser, by, element } from 'protractor'; 2 | 3 | export class AppPage { 4 | navigateTo() { 5 | return browser.get('/'); 6 | } 7 | 8 | getTitleText() { 9 | return element(by.css('app-root h1')).getText(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Chapter07/chapter7_templates/e2e/tsconfig.e2e.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/app", 5 | "module": "commonjs", 6 | "target": "es5", 7 | "types": [ 8 | "jasmine", 9 | "jasminewd2", 10 | "node" 11 | ] 12 | } 13 | } -------------------------------------------------------------------------------- /Chapter07/chapter7_templates/src/app/app-routing.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { Routes, RouterModule } from '@angular/router'; 3 | 4 | const routes: Routes = []; 5 | 6 | @NgModule({ 7 | imports: [RouterModule.forRoot(routes)], 8 | exports: [RouterModule] 9 | }) 10 | export class AppRoutingModule { } 11 | -------------------------------------------------------------------------------- /Chapter07/chapter7_templates/src/app/app.component.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Angular-and-Bootstrap-Third-Edition/6d52dea530bc0835c7ec648c746aa5826cab48a9/Chapter07/chapter7_templates/src/app/app.component.scss -------------------------------------------------------------------------------- /Chapter07/chapter7_templates/src/assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Angular-and-Bootstrap-Third-Edition/6d52dea530bc0835c7ec648c746aa5826cab48a9/Chapter07/chapter7_templates/src/assets/.gitkeep -------------------------------------------------------------------------------- /Chapter07/chapter7_templates/src/browserslist: -------------------------------------------------------------------------------- 1 | # This file is currently used by autoprefixer to adjust CSS to support the below specified browsers 2 | # For additional information regarding the format and rule options, please see: 3 | # https://github.com/browserslist/browserslist#queries 4 | # 5 | # For IE 9-11 support, please remove 'not' from the last line of the file and adjust as needed 6 | 7 | > 0.5% 8 | last 2 versions 9 | Firefox ESR 10 | not dead 11 | not IE 9-11 -------------------------------------------------------------------------------- /Chapter07/chapter7_templates/src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true 3 | }; 4 | -------------------------------------------------------------------------------- /Chapter07/chapter7_templates/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Angular-and-Bootstrap-Third-Edition/6d52dea530bc0835c7ec648c746aa5826cab48a9/Chapter07/chapter7_templates/src/favicon.ico -------------------------------------------------------------------------------- /Chapter07/chapter7_templates/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | AngularTemplates 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /Chapter07/chapter7_templates/src/main.ts: -------------------------------------------------------------------------------- 1 | import { enableProdMode } from '@angular/core'; 2 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 3 | 4 | import { AppModule } from './app/app.module'; 5 | import { environment } from './environments/environment'; 6 | 7 | if (environment.production) { 8 | enableProdMode(); 9 | } 10 | 11 | platformBrowserDynamic().bootstrapModule(AppModule) 12 | .catch(err => console.error(err)); 13 | -------------------------------------------------------------------------------- /Chapter07/chapter7_templates/src/styles.scss: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | .super-car { 3 | color:#fff; 4 | background-color:#ff0000; 5 | } 6 | .sports-car { 7 | color:#000; 8 | background-color:#ffa500; 9 | } 10 | .grandma-car { 11 | color:#000; 12 | background-color:#ffff00; 13 | } -------------------------------------------------------------------------------- /Chapter07/chapter7_templates/src/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/app", 5 | "types": [] 6 | }, 7 | "exclude": [ 8 | "test.ts", 9 | "**/*.spec.ts" 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /Chapter07/chapter7_templates/src/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/spec", 5 | "types": [ 6 | "jasmine", 7 | "node" 8 | ] 9 | }, 10 | "files": [ 11 | "test.ts", 12 | "polyfills.ts" 13 | ], 14 | "include": [ 15 | "**/*.spec.ts", 16 | "**/*.d.ts" 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /Chapter07/chapter7_templates/src/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tslint.json", 3 | "rules": { 4 | "directive-selector": [ 5 | true, 6 | "attribute", 7 | "app", 8 | "camelCase" 9 | ], 10 | "component-selector": [ 11 | true, 12 | "element", 13 | "app", 14 | "kebab-case" 15 | ] 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Chapter08/chapter8_ngBootstrap/.editorconfig: -------------------------------------------------------------------------------- 1 | # Editor configuration, see https://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 | -------------------------------------------------------------------------------- /Chapter08/chapter8_ngBootstrap/e2e/src/app.e2e-spec.ts: -------------------------------------------------------------------------------- 1 | import { AppPage } from './app.po'; 2 | 3 | describe('workspace-project App', () => { 4 | let page: AppPage; 5 | 6 | beforeEach(() => { 7 | page = new AppPage(); 8 | }); 9 | 10 | it('should display welcome message', () => { 11 | page.navigateTo(); 12 | expect(page.getTitleText()).toEqual('Welcome to ngBootstrap!'); 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /Chapter08/chapter8_ngBootstrap/e2e/src/app.po.ts: -------------------------------------------------------------------------------- 1 | import { browser, by, element } from 'protractor'; 2 | 3 | export class AppPage { 4 | navigateTo() { 5 | return browser.get('/'); 6 | } 7 | 8 | getTitleText() { 9 | return element(by.css('app-root h1')).getText(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Chapter08/chapter8_ngBootstrap/e2e/tsconfig.e2e.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/app", 5 | "module": "commonjs", 6 | "target": "es5", 7 | "types": [ 8 | "jasmine", 9 | "jasminewd2", 10 | "node" 11 | ] 12 | } 13 | } -------------------------------------------------------------------------------- /Chapter08/chapter8_ngBootstrap/src/app/app-routing.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { Routes, RouterModule } from '@angular/router'; 3 | 4 | const routes: Routes = []; 5 | 6 | @NgModule({ 7 | imports: [RouterModule.forRoot(routes)], 8 | exports: [RouterModule] 9 | }) 10 | export class AppRoutingModule { } 11 | -------------------------------------------------------------------------------- /Chapter08/chapter8_ngBootstrap/src/app/app.component.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /Chapter08/chapter8_ngBootstrap/src/app/app.component.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Angular-and-Bootstrap-Third-Edition/6d52dea530bc0835c7ec648c746aa5826cab48a9/Chapter08/chapter8_ngBootstrap/src/app/app.component.scss -------------------------------------------------------------------------------- /Chapter08/chapter8_ngBootstrap/src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-root', 5 | templateUrl: './app.component.html', 6 | styleUrls: ['./app.component.scss'] 7 | }) 8 | export class AppComponent { 9 | title = 'ngBootstrap'; 10 | } 11 | -------------------------------------------------------------------------------- /Chapter08/chapter8_ngBootstrap/src/app/ngb-carousel/ngb-carousel.component.scss: -------------------------------------------------------------------------------- 1 | .carousel { 2 | width: 500px; 3 | } -------------------------------------------------------------------------------- /Chapter08/chapter8_ngBootstrap/src/app/ngb-collapse/ngb-collapse.component.html: -------------------------------------------------------------------------------- 1 |

2 | 5 |

6 |
7 |
8 |
9 | These are the hypothetical instructions for something. 10 |
11 |
12 |
-------------------------------------------------------------------------------- /Chapter08/chapter8_ngBootstrap/src/app/ngb-collapse/ngb-collapse.component.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Angular-and-Bootstrap-Third-Edition/6d52dea530bc0835c7ec648c746aa5826cab48a9/Chapter08/chapter8_ngBootstrap/src/app/ngb-collapse/ngb-collapse.component.scss -------------------------------------------------------------------------------- /Chapter08/chapter8_ngBootstrap/src/app/ngb-collapse/ngb-collapse.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-ngb-collapse', 5 | templateUrl: './ngb-collapse.component.html', 6 | styleUrls: ['./ngb-collapse.component.scss'] 7 | }) 8 | export class NgbCollapseComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | public isCollapsed = true; 16 | 17 | } 18 | -------------------------------------------------------------------------------- /Chapter08/chapter8_ngBootstrap/src/app/ngb-modal/ngb-modal.component.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Angular-and-Bootstrap-Third-Edition/6d52dea530bc0835c7ec648c746aa5826cab48a9/Chapter08/chapter8_ngBootstrap/src/app/ngb-modal/ngb-modal.component.scss -------------------------------------------------------------------------------- /Chapter08/chapter8_ngBootstrap/src/app/playground/playground.component.html: -------------------------------------------------------------------------------- 1 |

2 | {{pageTitle}} 3 |

4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Chapter08/chapter8_ngBootstrap/src/app/playground/playground.component.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Angular-and-Bootstrap-Third-Edition/6d52dea530bc0835c7ec648c746aa5826cab48a9/Chapter08/chapter8_ngBootstrap/src/app/playground/playground.component.scss -------------------------------------------------------------------------------- /Chapter08/chapter8_ngBootstrap/src/app/playground/playground.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-playground', 5 | templateUrl: './playground.component.html', 6 | styleUrls: ['./playground.component.scss'] 7 | }) 8 | export class PlaygroundComponent implements OnInit { 9 | 10 | pageTitle: string = "Playground"; 11 | 12 | constructor() { } 13 | 14 | ngOnInit() { 15 | } 16 | 17 | 18 | 19 | } 20 | -------------------------------------------------------------------------------- /Chapter08/chapter8_ngBootstrap/src/assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Angular-and-Bootstrap-Third-Edition/6d52dea530bc0835c7ec648c746aa5826cab48a9/Chapter08/chapter8_ngBootstrap/src/assets/.gitkeep -------------------------------------------------------------------------------- /Chapter08/chapter8_ngBootstrap/src/browserslist: -------------------------------------------------------------------------------- 1 | # This file is currently used by autoprefixer to adjust CSS to support the below specified browsers 2 | # For additional information regarding the format and rule options, please see: 3 | # https://github.com/browserslist/browserslist#queries 4 | # 5 | # For IE 9-11 support, please remove 'not' from the last line of the file and adjust as needed 6 | 7 | > 0.5% 8 | last 2 versions 9 | Firefox ESR 10 | not dead 11 | not IE 9-11 -------------------------------------------------------------------------------- /Chapter08/chapter8_ngBootstrap/src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true 3 | }; 4 | -------------------------------------------------------------------------------- /Chapter08/chapter8_ngBootstrap/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Angular-and-Bootstrap-Third-Edition/6d52dea530bc0835c7ec648c746aa5826cab48a9/Chapter08/chapter8_ngBootstrap/src/favicon.ico -------------------------------------------------------------------------------- /Chapter08/chapter8_ngBootstrap/src/main.ts: -------------------------------------------------------------------------------- 1 | import { enableProdMode } from '@angular/core'; 2 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 3 | 4 | import { AppModule } from './app/app.module'; 5 | import { environment } from './environments/environment'; 6 | 7 | if (environment.production) { 8 | enableProdMode(); 9 | } 10 | 11 | platformBrowserDynamic().bootstrapModule(AppModule) 12 | .catch(err => console.error(err)); 13 | -------------------------------------------------------------------------------- /Chapter08/chapter8_ngBootstrap/src/styles.scss: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | -------------------------------------------------------------------------------- /Chapter08/chapter8_ngBootstrap/src/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/app", 5 | "types": [] 6 | }, 7 | "exclude": [ 8 | "test.ts", 9 | "**/*.spec.ts" 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /Chapter08/chapter8_ngBootstrap/src/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/spec", 5 | "types": [ 6 | "jasmine", 7 | "node" 8 | ] 9 | }, 10 | "files": [ 11 | "test.ts", 12 | "polyfills.ts" 13 | ], 14 | "include": [ 15 | "**/*.spec.ts", 16 | "**/*.d.ts" 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /Chapter08/chapter8_ngBootstrap/src/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tslint.json", 3 | "rules": { 4 | "directive-selector": [ 5 | true, 6 | "attribute", 7 | "app", 8 | "camelCase" 9 | ], 10 | "component-selector": [ 11 | true, 12 | "element", 13 | "app", 14 | "kebab-case" 15 | ] 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Chapter09/chapter9_angularMaterial/.editorconfig: -------------------------------------------------------------------------------- 1 | # Editor configuration, see https://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 | -------------------------------------------------------------------------------- /Chapter09/chapter9_angularMaterial/e2e/src/app.po.ts: -------------------------------------------------------------------------------- 1 | import { browser, by, element } from 'protractor'; 2 | 3 | export class AppPage { 4 | navigateTo() { 5 | return browser.get(browser.baseUrl) as Promise; 6 | } 7 | 8 | getTitleText() { 9 | return element(by.css('app-root h1')).getText() as Promise; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Chapter09/chapter9_angularMaterial/e2e/tsconfig.e2e.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/app", 5 | "module": "commonjs", 6 | "target": "es5", 7 | "types": [ 8 | "jasmine", 9 | "jasminewd2", 10 | "node" 11 | ] 12 | } 13 | } -------------------------------------------------------------------------------- /Chapter09/chapter9_angularMaterial/src/app/add-dialog/add-dialog.component.html: -------------------------------------------------------------------------------- 1 |

Welcome to Dialog

2 | 3 | 4 | This is material dialog window 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /Chapter09/chapter9_angularMaterial/src/app/add-dialog/add-dialog.component.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Angular-and-Bootstrap-Third-Edition/6d52dea530bc0835c7ec648c746aa5826cab48a9/Chapter09/chapter9_angularMaterial/src/app/add-dialog/add-dialog.component.scss -------------------------------------------------------------------------------- /Chapter09/chapter9_angularMaterial/src/app/add-dialog/add-dialog.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-add-dialog', 5 | templateUrl: './add-dialog.component.html', 6 | styleUrls: ['./add-dialog.component.scss'] 7 | }) 8 | export class AddDialogComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /Chapter09/chapter9_angularMaterial/src/app/app.component.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Angular-and-Bootstrap-Third-Edition/6d52dea530bc0835c7ec648c746aa5826cab48a9/Chapter09/chapter9_angularMaterial/src/app/app.component.scss -------------------------------------------------------------------------------- /Chapter09/chapter9_angularMaterial/src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-root', 5 | templateUrl: './app.component.html', 6 | styleUrls: ['./app.component.scss'] 7 | }) 8 | export class AppComponent { 9 | title = 'AngularMaterial'; 10 | } 11 | -------------------------------------------------------------------------------- /Chapter09/chapter9_angularMaterial/src/app/bootstrap-material-combo/bootstrap-material-combo.component.html: -------------------------------------------------------------------------------- 1 |

2 | bootstrap-material-combo works! 3 |

4 | -------------------------------------------------------------------------------- /Chapter09/chapter9_angularMaterial/src/app/bootstrap-material-combo/bootstrap-material-combo.component.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Angular-and-Bootstrap-Third-Edition/6d52dea530bc0835c7ec648c746aa5826cab48a9/Chapter09/chapter9_angularMaterial/src/app/bootstrap-material-combo/bootstrap-material-combo.component.scss -------------------------------------------------------------------------------- /Chapter09/chapter9_angularMaterial/src/app/bootstrap-material-combo/bootstrap-material-combo.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-bootstrap-material-combo', 5 | templateUrl: './bootstrap-material-combo.component.html', 6 | styleUrls: ['./bootstrap-material-combo.component.scss'] 7 | }) 8 | export class BootstrapMaterialComboComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /Chapter09/chapter9_angularMaterial/src/app/issue-list/issue-list.component.css: -------------------------------------------------------------------------------- 1 | .full-width-table { 2 | width: 100%; 3 | } 4 | -------------------------------------------------------------------------------- /Chapter09/chapter9_angularMaterial/src/app/material-buttons/material-buttons.component.scss: -------------------------------------------------------------------------------- 1 | button { 2 | margin:8px; 3 | } -------------------------------------------------------------------------------- /Chapter09/chapter9_angularMaterial/src/app/material-buttons/material-buttons.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-material-buttons', 5 | templateUrl: './material-buttons.component.html', 6 | styleUrls: ['./material-buttons.component.scss'] 7 | }) 8 | export class MaterialButtonsComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /Chapter09/chapter9_angularMaterial/src/app/material-cards/material-cards.component.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Angular-and-Bootstrap-Third-Edition/6d52dea530bc0835c7ec648c746aa5826cab48a9/Chapter09/chapter9_angularMaterial/src/app/material-cards/material-cards.component.scss -------------------------------------------------------------------------------- /Chapter09/chapter9_angularMaterial/src/app/material-cards/material-cards.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-material-cards', 5 | templateUrl: './material-cards.component.html', 6 | styleUrls: ['./material-cards.component.scss'] 7 | }) 8 | export class MaterialCardsComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | menuLinks: string[] = ['Home', 'About Us', 'Contact Us', 'Blog']; 16 | } 17 | -------------------------------------------------------------------------------- /Chapter09/chapter9_angularMaterial/src/app/material-form/material-form.component.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Angular-and-Bootstrap-Third-Edition/6d52dea530bc0835c7ec648c746aa5826cab48a9/Chapter09/chapter9_angularMaterial/src/app/material-form/material-form.component.scss -------------------------------------------------------------------------------- /Chapter09/chapter9_angularMaterial/src/app/material-form/material-form.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-material-form', 5 | templateUrl: './material-form.component.html', 6 | styleUrls: ['./material-form.component.scss'] 7 | }) 8 | export class MaterialFormComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /Chapter09/chapter9_angularMaterial/src/app/material-layout/material-layout.component.html: -------------------------------------------------------------------------------- 1 |

2 | material-layout works! 3 |

4 | -------------------------------------------------------------------------------- /Chapter09/chapter9_angularMaterial/src/app/material-layout/material-layout.component.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Angular-and-Bootstrap-Third-Edition/6d52dea530bc0835c7ec648c746aa5826cab48a9/Chapter09/chapter9_angularMaterial/src/app/material-layout/material-layout.component.scss -------------------------------------------------------------------------------- /Chapter09/chapter9_angularMaterial/src/app/material-layout/material-layout.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-material-layout', 5 | templateUrl: './material-layout.component.html', 6 | styleUrls: ['./material-layout.component.scss'] 7 | }) 8 | export class MaterialLayoutComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /Chapter09/chapter9_angularMaterial/src/app/material-modals/create-new.html: -------------------------------------------------------------------------------- 1 |

Hi There

2 |
3 |

What's your favorite animal?

4 | 5 | 6 | 7 |
8 |
9 | 10 | 11 |
-------------------------------------------------------------------------------- /Chapter09/chapter9_angularMaterial/src/app/material-modals/material-modals.component.html: -------------------------------------------------------------------------------- 1 |

2 | material-modals works! 3 |

4 |

Modal Windows

5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Chapter09/chapter9_angularMaterial/src/app/material-modals/material-modals.component.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Angular-and-Bootstrap-Third-Edition/6d52dea530bc0835c7ec648c746aa5826cab48a9/Chapter09/chapter9_angularMaterial/src/app/material-modals/material-modals.component.scss -------------------------------------------------------------------------------- /Chapter09/chapter9_angularMaterial/src/app/material-navigation/material-navigation.component.scss: -------------------------------------------------------------------------------- 1 | .toolbar-filler { 2 | flex: 1 1 auto; 3 | } -------------------------------------------------------------------------------- /Chapter09/chapter9_angularMaterial/src/app/material-navigation/material-navigation.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-material-navigation', 5 | templateUrl: './material-navigation.component.html', 6 | styleUrls: ['./material-navigation.component.scss'] 7 | }) 8 | export class MaterialNavigationComponent implements OnInit { 9 | 10 | title = "Angular Material"; 11 | 12 | constructor() { } 13 | 14 | ngOnInit() { 15 | } 16 | 17 | 18 | 19 | } 20 | -------------------------------------------------------------------------------- /Chapter09/chapter9_angularMaterial/src/app/material-table/material-table.component.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Angular-and-Bootstrap-Third-Edition/6d52dea530bc0835c7ec648c746aa5826cab48a9/Chapter09/chapter9_angularMaterial/src/app/material-table/material-table.component.scss -------------------------------------------------------------------------------- /Chapter09/chapter9_angularMaterial/src/app/my-menu/my-menu.component.css: -------------------------------------------------------------------------------- 1 | .sidenav-container { 2 | height: 100%; 3 | } 4 | 5 | .sidenav { 6 | width: 200px; 7 | } 8 | 9 | .sidenav .mat-toolbar { 10 | background: inherit; 11 | } 12 | 13 | .mat-toolbar.mat-primary { 14 | position: sticky; 15 | top: 0; 16 | z-index: 1; 17 | } 18 | -------------------------------------------------------------------------------- /Chapter09/chapter9_angularMaterial/src/assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Angular-and-Bootstrap-Third-Edition/6d52dea530bc0835c7ec648c746aa5826cab48a9/Chapter09/chapter9_angularMaterial/src/assets/.gitkeep -------------------------------------------------------------------------------- /Chapter09/chapter9_angularMaterial/src/browserslist: -------------------------------------------------------------------------------- 1 | # This file is currently used by autoprefixer to adjust CSS to support the below specified browsers 2 | # For additional information regarding the format and rule options, please see: 3 | # https://github.com/browserslist/browserslist#queries 4 | # 5 | # For IE 9-11 support, please remove 'not' from the last line of the file and adjust as needed 6 | 7 | > 0.5% 8 | last 2 versions 9 | Firefox ESR 10 | not dead 11 | not IE 9-11 -------------------------------------------------------------------------------- /Chapter09/chapter9_angularMaterial/src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true 3 | }; 4 | -------------------------------------------------------------------------------- /Chapter09/chapter9_angularMaterial/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Angular-and-Bootstrap-Third-Edition/6d52dea530bc0835c7ec648c746aa5826cab48a9/Chapter09/chapter9_angularMaterial/src/favicon.ico -------------------------------------------------------------------------------- /Chapter09/chapter9_angularMaterial/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | AngularMaterial 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /Chapter09/chapter9_angularMaterial/src/main.ts: -------------------------------------------------------------------------------- 1 | import { enableProdMode } from '@angular/core'; 2 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 3 | 4 | import { AppModule } from './app/app.module'; 5 | import { environment } from './environments/environment'; 6 | 7 | if (environment.production) { 8 | enableProdMode(); 9 | } 10 | 11 | platformBrowserDynamic().bootstrapModule(AppModule) 12 | .catch(err => console.error(err)); 13 | -------------------------------------------------------------------------------- /Chapter09/chapter9_angularMaterial/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 | 4 | h2 { 5 | background: #FFEA00; 6 | color:#222; 7 | } 8 | 9 | .mat-toolbar a { 10 | color:#fff; 11 | margin:3px; 12 | font-size:16px; 13 | } 14 | .mat-card { 15 | margin:10px; 16 | } -------------------------------------------------------------------------------- /Chapter09/chapter9_angularMaterial/src/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/app", 5 | "types": [] 6 | }, 7 | "exclude": [ 8 | "test.ts", 9 | "**/*.spec.ts" 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /Chapter09/chapter9_angularMaterial/src/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/spec", 5 | "types": [ 6 | "jasmine", 7 | "node" 8 | ] 9 | }, 10 | "files": [ 11 | "test.ts", 12 | "polyfills.ts" 13 | ], 14 | "include": [ 15 | "**/*.spec.ts", 16 | "**/*.d.ts" 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /Chapter09/chapter9_angularMaterial/src/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tslint.json", 3 | "rules": { 4 | "directive-selector": [ 5 | true, 6 | "attribute", 7 | "app", 8 | "camelCase" 9 | ], 10 | "component-selector": [ 11 | true, 12 | "element", 13 | "app", 14 | "kebab-case" 15 | ] 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Chapter10/chapter10_angularforms/.editorconfig: -------------------------------------------------------------------------------- 1 | # Editor configuration, see https://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 | -------------------------------------------------------------------------------- /Chapter10/chapter10_angularforms/e2e/src/app.e2e-spec.ts: -------------------------------------------------------------------------------- 1 | import { AppPage } from './app.po'; 2 | 3 | describe('workspace-project App', () => { 4 | let page: AppPage; 5 | 6 | beforeEach(() => { 7 | page = new AppPage(); 8 | }); 9 | 10 | it('should display welcome message', () => { 11 | page.navigateTo(); 12 | expect(page.getTitleText()).toEqual('Welcome to AngularForms!'); 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /Chapter10/chapter10_angularforms/e2e/src/app.po.ts: -------------------------------------------------------------------------------- 1 | import { browser, by, element } from 'protractor'; 2 | 3 | export class AppPage { 4 | navigateTo() { 5 | return browser.get('/'); 6 | } 7 | 8 | getTitleText() { 9 | return element(by.css('app-root h1')).getText(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Chapter10/chapter10_angularforms/e2e/tsconfig.e2e.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/app", 5 | "module": "commonjs", 6 | "target": "es5", 7 | "types": [ 8 | "jasmine", 9 | "jasminewd2", 10 | "node" 11 | ] 12 | } 13 | } -------------------------------------------------------------------------------- /Chapter10/chapter10_angularforms/src/app/activate-admin.guard.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed, async, inject } from '@angular/core/testing'; 2 | 3 | import { ActivateAdminGuard } from './activate-admin.guard'; 4 | 5 | describe('ActivateAdminGuard', () => { 6 | beforeEach(() => { 7 | TestBed.configureTestingModule({ 8 | providers: [ActivateAdminGuard] 9 | }); 10 | }); 11 | 12 | it('should ...', inject([ActivateAdminGuard], (guard: ActivateAdminGuard) => { 13 | expect(guard).toBeTruthy(); 14 | })); 15 | }); 16 | -------------------------------------------------------------------------------- /Chapter10/chapter10_angularforms/src/app/app.component.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Angular-and-Bootstrap-Third-Edition/6d52dea530bc0835c7ec648c746aa5826cab48a9/Chapter10/chapter10_angularforms/src/app/app.component.scss -------------------------------------------------------------------------------- /Chapter10/chapter10_angularforms/src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-root', 5 | templateUrl: './app.component.html', 6 | styleUrls: ['./app.component.scss'] 7 | }) 8 | export class AppComponent { 9 | title = 'AngularForms'; 10 | } 11 | -------------------------------------------------------------------------------- /Chapter10/chapter10_angularforms/src/app/crud/crud.component.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Angular-and-Bootstrap-Third-Edition/6d52dea530bc0835c7ec648c746aa5826cab48a9/Chapter10/chapter10_angularforms/src/app/crud/crud.component.scss -------------------------------------------------------------------------------- /Chapter10/chapter10_angularforms/src/app/crud/crud.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-crud', 5 | templateUrl: './crud.component.html', 6 | styleUrls: ['./crud.component.scss'] 7 | }) 8 | export class CrudComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /Chapter10/chapter10_angularforms/src/app/login/login.component.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Angular-and-Bootstrap-Third-Edition/6d52dea530bc0835c7ec648c746aa5826cab48a9/Chapter10/chapter10_angularforms/src/app/login/login.component.scss -------------------------------------------------------------------------------- /Chapter10/chapter10_angularforms/src/app/login/login.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-login', 5 | templateUrl: './login.component.html', 6 | styleUrls: ['./login.component.scss'] 7 | }) 8 | export class LoginComponent { 9 | 10 | constructor() { } 11 | 12 | login(loginForm) 13 | { 14 | debugger; 15 | console.log(loginForm); 16 | console.log(loginForm.username); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Chapter10/chapter10_angularforms/src/app/payment-page/payment-page.component.html: -------------------------------------------------------------------------------- 1 |

2 | payment-page works! 3 |

4 | -------------------------------------------------------------------------------- /Chapter10/chapter10_angularforms/src/app/payment-page/payment-page.component.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Angular-and-Bootstrap-Third-Edition/6d52dea530bc0835c7ec648c746aa5826cab48a9/Chapter10/chapter10_angularforms/src/app/payment-page/payment-page.component.scss -------------------------------------------------------------------------------- /Chapter10/chapter10_angularforms/src/app/payment-page/payment-page.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-payment-page', 5 | templateUrl: './payment-page.component.html', 6 | styleUrls: ['./payment-page.component.scss'] 7 | }) 8 | export class PaymentPageComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /Chapter10/chapter10_angularforms/src/app/photos.guard.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed, async, inject } from '@angular/core/testing'; 2 | 3 | import { PhotosGuard } from './photos.guard'; 4 | 5 | describe('PhotosGuard', () => { 6 | beforeEach(() => { 7 | TestBed.configureTestingModule({ 8 | providers: [PhotosGuard] 9 | }); 10 | }); 11 | 12 | it('should ...', inject([PhotosGuard], (guard: PhotosGuard) => { 13 | expect(guard).toBeTruthy(); 14 | })); 15 | }); 16 | -------------------------------------------------------------------------------- /Chapter10/chapter10_angularforms/src/app/photos.guard.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | import { CanActivate, ActivatedRouteSnapshot, RouterStateSnapshot } from '@angular/router'; 3 | import { Observable } from 'rxjs'; 4 | 5 | @Injectable({ 6 | providedIn: 'root' 7 | }) 8 | export class PhotosGuard implements CanActivate { 9 | canActivate( 10 | next: ActivatedRouteSnapshot, 11 | state: RouterStateSnapshot): Observable | Promise | boolean { 12 | return true; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Chapter10/chapter10_angularforms/src/app/register/register.component.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Angular-and-Bootstrap-Third-Edition/6d52dea530bc0835c7ec648c746aa5826cab48a9/Chapter10/chapter10_angularforms/src/app/register/register.component.scss -------------------------------------------------------------------------------- /Chapter10/chapter10_angularforms/src/assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Angular-and-Bootstrap-Third-Edition/6d52dea530bc0835c7ec648c746aa5826cab48a9/Chapter10/chapter10_angularforms/src/assets/.gitkeep -------------------------------------------------------------------------------- /Chapter10/chapter10_angularforms/src/browserslist: -------------------------------------------------------------------------------- 1 | # This file is currently used by autoprefixer to adjust CSS to support the below specified browsers 2 | # For additional information regarding the format and rule options, please see: 3 | # https://github.com/browserslist/browserslist#queries 4 | # 5 | # For IE 9-11 support, please remove 'not' from the last line of the file and adjust as needed 6 | 7 | > 0.5% 8 | last 2 versions 9 | Firefox ESR 10 | not dead 11 | not IE 9-11 -------------------------------------------------------------------------------- /Chapter10/chapter10_angularforms/src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true 3 | }; 4 | -------------------------------------------------------------------------------- /Chapter10/chapter10_angularforms/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Angular-and-Bootstrap-Third-Edition/6d52dea530bc0835c7ec648c746aa5826cab48a9/Chapter10/chapter10_angularforms/src/favicon.ico -------------------------------------------------------------------------------- /Chapter10/chapter10_angularforms/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | AngularForms 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /Chapter10/chapter10_angularforms/src/main.ts: -------------------------------------------------------------------------------- 1 | import { enableProdMode } from '@angular/core'; 2 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 3 | 4 | import { AppModule } from './app/app.module'; 5 | import { environment } from './environments/environment'; 6 | 7 | if (environment.production) { 8 | enableProdMode(); 9 | } 10 | 11 | platformBrowserDynamic().bootstrapModule(AppModule) 12 | .catch(err => console.error(err)); 13 | -------------------------------------------------------------------------------- /Chapter10/chapter10_angularforms/src/styles.scss: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | 3 | body { 4 | background-color: #f5f5f5 !important; 5 | } 6 | .container { 7 | background-color:#fff; 8 | } -------------------------------------------------------------------------------- /Chapter10/chapter10_angularforms/src/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/app", 5 | "types": [] 6 | }, 7 | "exclude": [ 8 | "test.ts", 9 | "**/*.spec.ts" 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /Chapter10/chapter10_angularforms/src/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/spec", 5 | "types": [ 6 | "jasmine", 7 | "node" 8 | ] 9 | }, 10 | "files": [ 11 | "test.ts", 12 | "polyfills.ts" 13 | ], 14 | "include": [ 15 | "**/*.spec.ts", 16 | "**/*.d.ts" 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /Chapter10/chapter10_angularforms/src/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tslint.json", 3 | "rules": { 4 | "directive-selector": [ 5 | true, 6 | "attribute", 7 | "app", 8 | "camelCase" 9 | ], 10 | "component-selector": [ 11 | true, 12 | "element", 13 | "app", 14 | "kebab-case" 15 | ] 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Chapter11/chapter11_di_services/.editorconfig: -------------------------------------------------------------------------------- 1 | # Editor configuration, see https://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 | -------------------------------------------------------------------------------- /Chapter11/chapter11_di_services/e2e/src/app.e2e-spec.ts: -------------------------------------------------------------------------------- 1 | import { AppPage } from './app.po'; 2 | 3 | describe('workspace-project App', () => { 4 | let page: AppPage; 5 | 6 | beforeEach(() => { 7 | page = new AppPage(); 8 | }); 9 | 10 | it('should display welcome message', () => { 11 | page.navigateTo(); 12 | expect(page.getTitleText()).toEqual('Welcome to learningDIServices!'); 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /Chapter11/chapter11_di_services/e2e/src/app.po.ts: -------------------------------------------------------------------------------- 1 | import { browser, by, element } from 'protractor'; 2 | 3 | export class AppPage { 4 | navigateTo() { 5 | return browser.get('/'); 6 | } 7 | 8 | getTitleText() { 9 | return element(by.css('app-root h1')).getText(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Chapter11/chapter11_di_services/e2e/tsconfig.e2e.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/app", 5 | "module": "commonjs", 6 | "target": "es5", 7 | "types": [ 8 | "jasmine", 9 | "jasminewd2", 10 | "node" 11 | ] 12 | } 13 | } -------------------------------------------------------------------------------- /Chapter11/chapter11_di_services/src/app/app.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Angular-and-Bootstrap-Third-Edition/6d52dea530bc0835c7ec648c746aa5826cab48a9/Chapter11/chapter11_di_services/src/app/app.component.css -------------------------------------------------------------------------------- /Chapter11/chapter11_di_services/src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-root', 5 | templateUrl: './app.component.html', 6 | styleUrls: ['./app.component.css'] 7 | }) 8 | export class AppComponent { 9 | title = 'learningDIServices'; 10 | } 11 | -------------------------------------------------------------------------------- /Chapter11/chapter11_di_services/src/app/app.module.ts: -------------------------------------------------------------------------------- 1 | import { BrowserModule } from '@angular/platform-browser'; 2 | import { NgModule } from '@angular/core'; 3 | 4 | import { AppComponent } from './app.component'; 5 | 6 | @NgModule({ 7 | declarations: [ 8 | AppComponent 9 | ], 10 | imports: [ 11 | BrowserModule 12 | ], 13 | providers: [], 14 | bootstrap: [AppComponent] 15 | }) 16 | export class AppModule { } 17 | -------------------------------------------------------------------------------- /Chapter11/chapter11_di_services/src/app/photo.ts: -------------------------------------------------------------------------------- 1 | export interface Photo { 2 | } 3 | -------------------------------------------------------------------------------- /Chapter11/chapter11_di_services/src/app/photos.service.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed } from '@angular/core/testing'; 2 | 3 | import { PhotosService } from './photos.service'; 4 | 5 | describe('PhotosService', () => { 6 | beforeEach(() => TestBed.configureTestingModule({})); 7 | 8 | it('should be created', () => { 9 | const service: PhotosService = TestBed.get(PhotosService); 10 | expect(service).toBeTruthy(); 11 | }); 12 | }); 13 | -------------------------------------------------------------------------------- /Chapter11/chapter11_di_services/src/app/photos.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | 3 | @Injectable({ 4 | providedIn: 'root' 5 | }) 6 | export class PhotosService { 7 | 8 | constructor() { } 9 | } 10 | -------------------------------------------------------------------------------- /Chapter11/chapter11_di_services/src/assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Angular-and-Bootstrap-Third-Edition/6d52dea530bc0835c7ec648c746aa5826cab48a9/Chapter11/chapter11_di_services/src/assets/.gitkeep -------------------------------------------------------------------------------- /Chapter11/chapter11_di_services/src/browserslist: -------------------------------------------------------------------------------- 1 | # This file is currently used by autoprefixer to adjust CSS to support the below specified browsers 2 | # For additional information regarding the format and rule options, please see: 3 | # https://github.com/browserslist/browserslist#queries 4 | # 5 | # For IE 9-11 support, please remove 'not' from the last line of the file and adjust as needed 6 | 7 | > 0.5% 8 | last 2 versions 9 | Firefox ESR 10 | not dead 11 | not IE 9-11 -------------------------------------------------------------------------------- /Chapter11/chapter11_di_services/src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true 3 | }; 4 | -------------------------------------------------------------------------------- /Chapter11/chapter11_di_services/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Angular-and-Bootstrap-Third-Edition/6d52dea530bc0835c7ec648c746aa5826cab48a9/Chapter11/chapter11_di_services/src/favicon.ico -------------------------------------------------------------------------------- /Chapter11/chapter11_di_services/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | LearningDIServices 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /Chapter11/chapter11_di_services/src/main.ts: -------------------------------------------------------------------------------- 1 | import { enableProdMode } from '@angular/core'; 2 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 3 | 4 | import { AppModule } from './app/app.module'; 5 | import { environment } from './environments/environment'; 6 | 7 | if (environment.production) { 8 | enableProdMode(); 9 | } 10 | 11 | platformBrowserDynamic().bootstrapModule(AppModule) 12 | .catch(err => console.error(err)); 13 | -------------------------------------------------------------------------------- /Chapter11/chapter11_di_services/src/styles.css: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | -------------------------------------------------------------------------------- /Chapter11/chapter11_di_services/src/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/app", 5 | "types": [] 6 | }, 7 | "exclude": [ 8 | "test.ts", 9 | "**/*.spec.ts" 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /Chapter11/chapter11_di_services/src/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/spec", 5 | "types": [ 6 | "jasmine", 7 | "node" 8 | ] 9 | }, 10 | "files": [ 11 | "test.ts", 12 | "polyfills.ts" 13 | ], 14 | "include": [ 15 | "**/*.spec.ts", 16 | "**/*.d.ts" 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /Chapter11/chapter11_di_services/src/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tslint.json", 3 | "rules": { 4 | "directive-selector": [ 5 | true, 6 | "attribute", 7 | "app", 8 | "camelCase" 9 | ], 10 | "component-selector": [ 11 | true, 12 | "element", 13 | "app", 14 | "kebab-case" 15 | ] 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Chapter12/chapter12_angular_backend/.editorconfig: -------------------------------------------------------------------------------- 1 | # Editor configuration, see https://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 | -------------------------------------------------------------------------------- /Chapter12/chapter12_angular_backend/e2e/src/app.po.ts: -------------------------------------------------------------------------------- 1 | import { browser, by, element } from 'protractor'; 2 | 3 | export class AppPage { 4 | navigateTo() { 5 | return browser.get(browser.baseUrl) as Promise; 6 | } 7 | 8 | getTitleText() { 9 | return element(by.css('app-root h1')).getText() as Promise; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Chapter12/chapter12_angular_backend/e2e/tsconfig.e2e.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/app", 5 | "module": "commonjs", 6 | "target": "es5", 7 | "types": [ 8 | "jasmine", 9 | "jasminewd2", 10 | "node" 11 | ] 12 | } 13 | } -------------------------------------------------------------------------------- /Chapter12/chapter12_angular_backend/src/app/add-comments/add-comments.component.html: -------------------------------------------------------------------------------- 1 |

2 | add-comments works! 3 |

4 | -------------------------------------------------------------------------------- /Chapter12/chapter12_angular_backend/src/app/add-comments/add-comments.component.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Angular-and-Bootstrap-Third-Edition/6d52dea530bc0835c7ec648c746aa5826cab48a9/Chapter12/chapter12_angular_backend/src/app/add-comments/add-comments.component.scss -------------------------------------------------------------------------------- /Chapter12/chapter12_angular_backend/src/app/add-comments/add-comments.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-add-comments', 5 | templateUrl: './add-comments.component.html', 6 | styleUrls: ['./add-comments.component.scss'] 7 | }) 8 | export class AddCommentsComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /Chapter12/chapter12_angular_backend/src/app/app.component.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Angular-and-Bootstrap-Third-Edition/6d52dea530bc0835c7ec648c746aa5826cab48a9/Chapter12/chapter12_angular_backend/src/app/app.component.scss -------------------------------------------------------------------------------- /Chapter12/chapter12_angular_backend/src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-root', 5 | templateUrl: './app.component.html', 6 | styleUrls: ['./app.component.scss'] 7 | }) 8 | export class AppComponent { 9 | title = 'ListingApp'; 10 | } 11 | -------------------------------------------------------------------------------- /Chapter12/chapter12_angular_backend/src/app/create-listing/create-listing.component.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Angular-and-Bootstrap-Third-Edition/6d52dea530bc0835c7ec648c746aa5826cab48a9/Chapter12/chapter12_angular_backend/src/app/create-listing/create-listing.component.scss -------------------------------------------------------------------------------- /Chapter12/chapter12_angular_backend/src/app/crud-service.service.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed } from '@angular/core/testing'; 2 | 3 | import { CrudServiceService } from './crud-service.service'; 4 | 5 | describe('CrudServiceService', () => { 6 | beforeEach(() => TestBed.configureTestingModule({})); 7 | 8 | it('should be created', () => { 9 | const service: CrudServiceService = TestBed.get(CrudServiceService); 10 | expect(service).toBeTruthy(); 11 | }); 12 | }); 13 | -------------------------------------------------------------------------------- /Chapter12/chapter12_angular_backend/src/app/db-operations.service.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed } from '@angular/core/testing'; 2 | 3 | import { DbOperationsService } from './db-operations.service'; 4 | 5 | describe('DbOperationsService', () => { 6 | beforeEach(() => TestBed.configureTestingModule({})); 7 | 8 | it('should be created', () => { 9 | const service: DbOperationsService = TestBed.get(DbOperationsService); 10 | expect(service).toBeTruthy(); 11 | }); 12 | }); 13 | -------------------------------------------------------------------------------- /Chapter12/chapter12_angular_backend/src/app/delete-comments/delete-comments.component.html: -------------------------------------------------------------------------------- 1 |

2 | delete-comments works! 3 |

4 | -------------------------------------------------------------------------------- /Chapter12/chapter12_angular_backend/src/app/delete-comments/delete-comments.component.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Angular-and-Bootstrap-Third-Edition/6d52dea530bc0835c7ec648c746aa5826cab48a9/Chapter12/chapter12_angular_backend/src/app/delete-comments/delete-comments.component.scss -------------------------------------------------------------------------------- /Chapter12/chapter12_angular_backend/src/app/delete-comments/delete-comments.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-delete-comments', 5 | templateUrl: './delete-comments.component.html', 6 | styleUrls: ['./delete-comments.component.scss'] 7 | }) 8 | export class DeleteCommentsComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /Chapter12/chapter12_angular_backend/src/app/delete-listing/delete-listing.component.html: -------------------------------------------------------------------------------- 1 |

2 | delete-listing works! 3 |

4 | -------------------------------------------------------------------------------- /Chapter12/chapter12_angular_backend/src/app/delete-listing/delete-listing.component.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Angular-and-Bootstrap-Third-Edition/6d52dea530bc0835c7ec648c746aa5826cab48a9/Chapter12/chapter12_angular_backend/src/app/delete-listing/delete-listing.component.scss -------------------------------------------------------------------------------- /Chapter12/chapter12_angular_backend/src/app/edit-comments/edit-comments.component.html: -------------------------------------------------------------------------------- 1 |

2 | edit-comments works! 3 |

4 | -------------------------------------------------------------------------------- /Chapter12/chapter12_angular_backend/src/app/edit-comments/edit-comments.component.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Angular-and-Bootstrap-Third-Edition/6d52dea530bc0835c7ec648c746aa5826cab48a9/Chapter12/chapter12_angular_backend/src/app/edit-comments/edit-comments.component.scss -------------------------------------------------------------------------------- /Chapter12/chapter12_angular_backend/src/app/edit-comments/edit-comments.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-edit-comments', 5 | templateUrl: './edit-comments.component.html', 6 | styleUrls: ['./edit-comments.component.scss'] 7 | }) 8 | export class EditCommentsComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /Chapter12/chapter12_angular_backend/src/app/firebase-config.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: false, 3 | firebaseConfig : { 4 | apiKey: "AIzaSyDW0YvxtY3sGH-sWr1u8m9Tyk4QMS5Ho6U", 5 | authDomain: "photosdb-9cbec.firebaseapp.com", 6 | databaseURL: "https://photosdb-9cbec.firebaseio.com", 7 | projectId: "photosdb-9cbec", 8 | storageBucket: "photosdb-9cbec.appspot.com", 9 | messagingSenderId: "19978618750" 10 | } 11 | }; -------------------------------------------------------------------------------- /Chapter12/chapter12_angular_backend/src/app/models/listing.ts: -------------------------------------------------------------------------------- 1 | export interface Listing { 2 | id: number; 3 | userId: number; 4 | title: string; 5 | description: string; 6 | status: string; 7 | price: number; 8 | active: boolean; 9 | } -------------------------------------------------------------------------------- /Chapter12/chapter12_angular_backend/src/app/update-listing/update-listing.component.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Angular-and-Bootstrap-Third-Edition/6d52dea530bc0835c7ec648c746aa5826cab48a9/Chapter12/chapter12_angular_backend/src/app/update-listing/update-listing.component.scss -------------------------------------------------------------------------------- /Chapter12/chapter12_angular_backend/src/app/view-comments/view-comments.component.html: -------------------------------------------------------------------------------- 1 |

2 | view-comments works! 3 |

4 | -------------------------------------------------------------------------------- /Chapter12/chapter12_angular_backend/src/app/view-comments/view-comments.component.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Angular-and-Bootstrap-Third-Edition/6d52dea530bc0835c7ec648c746aa5826cab48a9/Chapter12/chapter12_angular_backend/src/app/view-comments/view-comments.component.scss -------------------------------------------------------------------------------- /Chapter12/chapter12_angular_backend/src/app/view-comments/view-comments.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-view-comments', 5 | templateUrl: './view-comments.component.html', 6 | styleUrls: ['./view-comments.component.scss'] 7 | }) 8 | export class ViewCommentsComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /Chapter12/chapter12_angular_backend/src/app/view-listing/view-listing.component.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Angular-and-Bootstrap-Third-Edition/6d52dea530bc0835c7ec648c746aa5826cab48a9/Chapter12/chapter12_angular_backend/src/app/view-listing/view-listing.component.scss -------------------------------------------------------------------------------- /Chapter12/chapter12_angular_backend/src/assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Angular-and-Bootstrap-Third-Edition/6d52dea530bc0835c7ec648c746aa5826cab48a9/Chapter12/chapter12_angular_backend/src/assets/.gitkeep -------------------------------------------------------------------------------- /Chapter12/chapter12_angular_backend/src/browserslist: -------------------------------------------------------------------------------- 1 | # This file is currently used by autoprefixer to adjust CSS to support the below specified browsers 2 | # For additional information regarding the format and rule options, please see: 3 | # https://github.com/browserslist/browserslist#queries 4 | # 5 | # For IE 9-11 support, please remove 'not' from the last line of the file and adjust as needed 6 | 7 | > 0.5% 8 | last 2 versions 9 | Firefox ESR 10 | not dead 11 | not IE 9-11 -------------------------------------------------------------------------------- /Chapter12/chapter12_angular_backend/src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true 3 | }; 4 | -------------------------------------------------------------------------------- /Chapter12/chapter12_angular_backend/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Angular-and-Bootstrap-Third-Edition/6d52dea530bc0835c7ec648c746aa5826cab48a9/Chapter12/chapter12_angular_backend/src/favicon.ico -------------------------------------------------------------------------------- /Chapter12/chapter12_angular_backend/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | ListingApp 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /Chapter12/chapter12_angular_backend/src/main.ts: -------------------------------------------------------------------------------- 1 | import { enableProdMode } from '@angular/core'; 2 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 3 | 4 | import { AppModule } from './app/app.module'; 5 | import { environment } from './environments/environment'; 6 | 7 | if (environment.production) { 8 | enableProdMode(); 9 | } 10 | 11 | platformBrowserDynamic().bootstrapModule(AppModule) 12 | .catch(err => console.error(err)); 13 | -------------------------------------------------------------------------------- /Chapter12/chapter12_angular_backend/src/styles.scss: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | h4 { 3 | background:#ffffcc; 4 | } 5 | .navbar { 6 | margin-top:10px; 7 | margin-bottom:10px; 8 | } -------------------------------------------------------------------------------- /Chapter12/chapter12_angular_backend/src/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/app", 5 | "types": [] 6 | }, 7 | "exclude": [ 8 | "test.ts", 9 | "**/*.spec.ts" 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /Chapter12/chapter12_angular_backend/src/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/spec", 5 | "types": [ 6 | "jasmine", 7 | "node" 8 | ] 9 | }, 10 | "files": [ 11 | "test.ts", 12 | "polyfills.ts" 13 | ], 14 | "include": [ 15 | "**/*.spec.ts", 16 | "**/*.d.ts" 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /Chapter12/chapter12_angular_backend/src/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tslint.json", 3 | "rules": { 4 | "directive-selector": [ 5 | true, 6 | "attribute", 7 | "app", 8 | "camelCase" 9 | ], 10 | "component-selector": [ 11 | true, 12 | "element", 13 | "app", 14 | "kebab-case" 15 | ] 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Chapter13/chapter_13_testing/.editorconfig: -------------------------------------------------------------------------------- 1 | # Editor configuration, see https://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 | -------------------------------------------------------------------------------- /Chapter13/chapter_13_testing/e2e/src/app.e2e-spec.ts: -------------------------------------------------------------------------------- 1 | import { AppPage } from './app.po'; 2 | 3 | describe('workspace-project App', () => { 4 | let page: AppPage; 5 | 6 | beforeEach(() => { 7 | page = new AppPage(); 8 | }); 9 | 10 | it('should display welcome message', () => { 11 | page.navigateTo(); 12 | expect(page.getTitleText()).toEqual('Welcome to testing-app!'); 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /Chapter13/chapter_13_testing/e2e/src/app.po.ts: -------------------------------------------------------------------------------- 1 | import { browser, by, element } from 'protractor'; 2 | 3 | export class AppPage { 4 | navigateTo() { 5 | return browser.get('/'); 6 | } 7 | 8 | getTitleText() { 9 | return element(by.css('app-root h1')).getText(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Chapter13/chapter_13_testing/e2e/tsconfig.e2e.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/app", 5 | "module": "commonjs", 6 | "target": "es5", 7 | "types": [ 8 | "jasmine", 9 | "jasminewd2", 10 | "node" 11 | ] 12 | } 13 | } -------------------------------------------------------------------------------- /Chapter13/chapter_13_testing/src/app/app.component.html: -------------------------------------------------------------------------------- 1 | 2 |
3 |

4 | Welcome to {{ title }}! 5 |

6 |
7 | 8 | 9 |
10 | 11 | 12 | -------------------------------------------------------------------------------- /Chapter13/chapter_13_testing/src/app/app.component.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Angular-and-Bootstrap-Third-Edition/6d52dea530bc0835c7ec648c746aa5826cab48a9/Chapter13/chapter_13_testing/src/app/app.component.scss -------------------------------------------------------------------------------- /Chapter13/chapter_13_testing/src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-root', 5 | templateUrl: './app.component.html', 6 | styleUrls: ['./app.component.scss'] 7 | }) 8 | export class AppComponent { 9 | title = 'AutoStop'; 10 | } 11 | -------------------------------------------------------------------------------- /Chapter13/chapter_13_testing/src/app/auto-list/auto-list.component.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Angular-and-Bootstrap-Third-Edition/6d52dea530bc0835c7ec648c746aa5826cab48a9/Chapter13/chapter_13_testing/src/app/auto-list/auto-list.component.scss -------------------------------------------------------------------------------- /Chapter13/chapter_13_testing/src/app/cars.ts: -------------------------------------------------------------------------------- 1 | export interface Cars { 2 | id: number; 3 | CarName: string; 4 | } -------------------------------------------------------------------------------- /Chapter13/chapter_13_testing/src/app/menu/menu.component.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Angular-and-Bootstrap-Third-Edition/6d52dea530bc0835c7ec648c746aa5826cab48a9/Chapter13/chapter_13_testing/src/app/menu/menu.component.scss -------------------------------------------------------------------------------- /Chapter13/chapter_13_testing/src/app/menu/menu.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-menu', 5 | templateUrl: './menu.component.html', 6 | styleUrls: ['./menu.component.scss'] 7 | }) 8 | export class MenuComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /Chapter13/chapter_13_testing/src/app/services/cars.json: -------------------------------------------------------------------------------- 1 | { 2 | "cars": [ 3 | { "id": 1, "name": "BMW"}, 4 | { "id": 2, "name": "Audi" } 5 | ] 6 | } -------------------------------------------------------------------------------- /Chapter13/chapter_13_testing/src/app/services/dealers.ts: -------------------------------------------------------------------------------- 1 | export class Dealers { 2 | 3 | constructor( 4 | public username: string = '', 5 | public name: string = '' 6 | ) {}; 7 | 8 | } -------------------------------------------------------------------------------- /Chapter13/chapter_13_testing/src/app/used-cars/used-cars.component.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Angular-and-Bootstrap-Third-Edition/6d52dea530bc0835c7ec648c746aa5826cab48a9/Chapter13/chapter_13_testing/src/app/used-cars/used-cars.component.scss -------------------------------------------------------------------------------- /Chapter13/chapter_13_testing/src/assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Angular-and-Bootstrap-Third-Edition/6d52dea530bc0835c7ec648c746aa5826cab48a9/Chapter13/chapter_13_testing/src/assets/.gitkeep -------------------------------------------------------------------------------- /Chapter13/chapter_13_testing/src/browserslist: -------------------------------------------------------------------------------- 1 | # This file is currently used by autoprefixer to adjust CSS to support the below specified browsers 2 | # For additional information regarding the format and rule options, please see: 3 | # https://github.com/browserslist/browserslist#queries 4 | # 5 | # For IE 9-11 support, please remove 'not' from the last line of the file and adjust as needed 6 | 7 | > 0.5% 8 | last 2 versions 9 | Firefox ESR 10 | not dead 11 | not IE 9-11 -------------------------------------------------------------------------------- /Chapter13/chapter_13_testing/src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true 3 | }; 4 | -------------------------------------------------------------------------------- /Chapter13/chapter_13_testing/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Angular-and-Bootstrap-Third-Edition/6d52dea530bc0835c7ec648c746aa5826cab48a9/Chapter13/chapter_13_testing/src/favicon.ico -------------------------------------------------------------------------------- /Chapter13/chapter_13_testing/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | TestingApp 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /Chapter13/chapter_13_testing/src/main.ts: -------------------------------------------------------------------------------- 1 | import { enableProdMode } from '@angular/core'; 2 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 3 | 4 | import { AppModule } from './app/app.module'; 5 | import { environment } from './environments/environment'; 6 | 7 | if (environment.production) { 8 | enableProdMode(); 9 | } 10 | 11 | platformBrowserDynamic().bootstrapModule(AppModule) 12 | .catch(err => console.error(err)); 13 | -------------------------------------------------------------------------------- /Chapter13/chapter_13_testing/src/styles.scss: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | @import "../node_modules/bootstrap/dist/css/bootstrap.min.css"; 3 | 4 | .c1 { 5 | background: #ffda65; 6 | } 7 | .c2 { 8 | background: #b8db70; 9 | } 10 | .c3 { 11 | background:#b7dbed; 12 | } -------------------------------------------------------------------------------- /Chapter13/chapter_13_testing/src/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/app", 5 | "types": [] 6 | }, 7 | "exclude": [ 8 | "test.ts", 9 | "**/*.spec.ts" 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /Chapter13/chapter_13_testing/src/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/spec", 5 | "types": [ 6 | "jasmine", 7 | "node" 8 | ] 9 | }, 10 | "files": [ 11 | "test.ts", 12 | "polyfills.ts" 13 | ], 14 | "include": [ 15 | "**/*.spec.ts", 16 | "**/*.d.ts" 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /Chapter13/chapter_13_testing/src/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tslint.json", 3 | "rules": { 4 | "directive-selector": [ 5 | true, 6 | "attribute", 7 | "app", 8 | "camelCase" 9 | ], 10 | "component-selector": [ 11 | true, 12 | "element", 13 | "app", 14 | "kebab-case" 15 | ] 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Chapter13/chapter_13_unit_tests/.editorconfig: -------------------------------------------------------------------------------- 1 | # Editor configuration, see https://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 | -------------------------------------------------------------------------------- /Chapter13/chapter_13_unit_tests/e2e/src/app.e2e-spec.ts: -------------------------------------------------------------------------------- 1 | import { AppPage } from './app.po'; 2 | 3 | describe('workspace-project App', () => { 4 | let page: AppPage; 5 | 6 | beforeEach(() => { 7 | page = new AppPage(); 8 | }); 9 | 10 | it('should display welcome message', () => { 11 | page.navigateTo(); 12 | expect(page.getTitleText()).toEqual('Welcome to testing-app!'); 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /Chapter13/chapter_13_unit_tests/e2e/src/app.po.ts: -------------------------------------------------------------------------------- 1 | import { browser, by, element } from 'protractor'; 2 | 3 | export class AppPage { 4 | navigateTo() { 5 | return browser.get('/'); 6 | } 7 | 8 | getTitleText() { 9 | return element(by.css('app-root h1')).getText(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Chapter13/chapter_13_unit_tests/e2e/tsconfig.e2e.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/app", 5 | "module": "commonjs", 6 | "target": "es5", 7 | "types": [ 8 | "jasmine", 9 | "jasminewd2", 10 | "node" 11 | ] 12 | } 13 | } -------------------------------------------------------------------------------- /Chapter13/chapter_13_unit_tests/src/app/app.component.html: -------------------------------------------------------------------------------- 1 | 2 |
3 |

4 | Welcome to {{ title }}! 5 |

6 |
7 | 8 | 9 |
10 | 11 | 12 | -------------------------------------------------------------------------------- /Chapter13/chapter_13_unit_tests/src/app/app.component.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Angular-and-Bootstrap-Third-Edition/6d52dea530bc0835c7ec648c746aa5826cab48a9/Chapter13/chapter_13_unit_tests/src/app/app.component.scss -------------------------------------------------------------------------------- /Chapter13/chapter_13_unit_tests/src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-root', 5 | templateUrl: './app.component.html', 6 | styleUrls: ['./app.component.scss'] 7 | }) 8 | export class AppComponent { 9 | title = 'AutoStop'; 10 | } 11 | -------------------------------------------------------------------------------- /Chapter13/chapter_13_unit_tests/src/app/auto-list/auto-list.component.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Angular-and-Bootstrap-Third-Edition/6d52dea530bc0835c7ec648c746aa5826cab48a9/Chapter13/chapter_13_unit_tests/src/app/auto-list/auto-list.component.scss -------------------------------------------------------------------------------- /Chapter13/chapter_13_unit_tests/src/app/cars.ts: -------------------------------------------------------------------------------- 1 | export interface Cars { 2 | id: number; 3 | CarName: string; 4 | } -------------------------------------------------------------------------------- /Chapter13/chapter_13_unit_tests/src/app/menu/menu.component.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Angular-and-Bootstrap-Third-Edition/6d52dea530bc0835c7ec648c746aa5826cab48a9/Chapter13/chapter_13_unit_tests/src/app/menu/menu.component.scss -------------------------------------------------------------------------------- /Chapter13/chapter_13_unit_tests/src/app/menu/menu.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-menu', 5 | templateUrl: './menu.component.html', 6 | styleUrls: ['./menu.component.scss'] 7 | }) 8 | export class MenuComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /Chapter13/chapter_13_unit_tests/src/app/services/cars.json: -------------------------------------------------------------------------------- 1 | { 2 | "cars": [ 3 | { "id": 1, "name": "BMW"}, 4 | { "id": 2, "name": "Audi" } 5 | ] 6 | } -------------------------------------------------------------------------------- /Chapter13/chapter_13_unit_tests/src/app/services/dealers.ts: -------------------------------------------------------------------------------- 1 | export class Dealers { 2 | 3 | constructor( 4 | public username: string = '', 5 | public name: string = '' 6 | ) {}; 7 | 8 | } -------------------------------------------------------------------------------- /Chapter13/chapter_13_unit_tests/src/app/used-cars/used-cars.component.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Angular-and-Bootstrap-Third-Edition/6d52dea530bc0835c7ec648c746aa5826cab48a9/Chapter13/chapter_13_unit_tests/src/app/used-cars/used-cars.component.scss -------------------------------------------------------------------------------- /Chapter13/chapter_13_unit_tests/src/assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Angular-and-Bootstrap-Third-Edition/6d52dea530bc0835c7ec648c746aa5826cab48a9/Chapter13/chapter_13_unit_tests/src/assets/.gitkeep -------------------------------------------------------------------------------- /Chapter13/chapter_13_unit_tests/src/browserslist: -------------------------------------------------------------------------------- 1 | # This file is currently used by autoprefixer to adjust CSS to support the below specified browsers 2 | # For additional information regarding the format and rule options, please see: 3 | # https://github.com/browserslist/browserslist#queries 4 | # 5 | # For IE 9-11 support, please remove 'not' from the last line of the file and adjust as needed 6 | 7 | > 0.5% 8 | last 2 versions 9 | Firefox ESR 10 | not dead 11 | not IE 9-11 -------------------------------------------------------------------------------- /Chapter13/chapter_13_unit_tests/src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true 3 | }; 4 | -------------------------------------------------------------------------------- /Chapter13/chapter_13_unit_tests/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Angular-and-Bootstrap-Third-Edition/6d52dea530bc0835c7ec648c746aa5826cab48a9/Chapter13/chapter_13_unit_tests/src/favicon.ico -------------------------------------------------------------------------------- /Chapter13/chapter_13_unit_tests/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | TestingApp 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /Chapter13/chapter_13_unit_tests/src/main.ts: -------------------------------------------------------------------------------- 1 | import { enableProdMode } from '@angular/core'; 2 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 3 | 4 | import { AppModule } from './app/app.module'; 5 | import { environment } from './environments/environment'; 6 | 7 | if (environment.production) { 8 | enableProdMode(); 9 | } 10 | 11 | platformBrowserDynamic().bootstrapModule(AppModule) 12 | .catch(err => console.error(err)); 13 | -------------------------------------------------------------------------------- /Chapter13/chapter_13_unit_tests/src/styles.scss: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | @import "../node_modules/bootstrap/dist/css/bootstrap.min.css"; 3 | 4 | .c1 { 5 | background: #ffda65; 6 | } 7 | .c2 { 8 | background: #b8db70; 9 | } 10 | .c3 { 11 | background:#b7dbed; 12 | } -------------------------------------------------------------------------------- /Chapter13/chapter_13_unit_tests/src/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/app", 5 | "types": [] 6 | }, 7 | "exclude": [ 8 | "test.ts", 9 | "**/*.spec.ts" 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /Chapter13/chapter_13_unit_tests/src/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/spec", 5 | "types": [ 6 | "jasmine", 7 | "node" 8 | ] 9 | }, 10 | "files": [ 11 | "test.ts", 12 | "polyfills.ts" 13 | ], 14 | "include": [ 15 | "**/*.spec.ts", 16 | "**/*.d.ts" 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /Chapter13/chapter_13_unit_tests/src/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tslint.json", 3 | "rules": { 4 | "directive-selector": [ 5 | true, 6 | "attribute", 7 | "app", 8 | "camelCase" 9 | ], 10 | "component-selector": [ 11 | true, 12 | "element", 13 | "app", 14 | "kebab-case" 15 | ] 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Chapter14/chapter14-firebase-app/.editorconfig: -------------------------------------------------------------------------------- 1 | # Editor configuration, see https://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 | -------------------------------------------------------------------------------- /Chapter14/chapter14-firebase-app/e2e/src/app.e2e-spec.ts: -------------------------------------------------------------------------------- 1 | import { AppPage } from './app.po'; 2 | 3 | describe('workspace-project App', () => { 4 | let page: AppPage; 5 | 6 | beforeEach(() => { 7 | page = new AppPage(); 8 | }); 9 | 10 | it('should display welcome message', () => { 11 | page.navigateTo(); 12 | expect(page.getTitleText()).toEqual('Welcome to angular-firebase-app!'); 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /Chapter14/chapter14-firebase-app/e2e/src/app.po.ts: -------------------------------------------------------------------------------- 1 | import { browser, by, element } from 'protractor'; 2 | 3 | export class AppPage { 4 | navigateTo() { 5 | return browser.get('/'); 6 | } 7 | 8 | getTitleText() { 9 | return element(by.css('app-root h1')).getText(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Chapter14/chapter14-firebase-app/e2e/tsconfig.e2e.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/app", 5 | "module": "commonjs", 6 | "target": "es5", 7 | "types": [ 8 | "jasmine", 9 | "jasminewd2", 10 | "node" 11 | ] 12 | } 13 | } -------------------------------------------------------------------------------- /Chapter14/chapter14-firebase-app/src/app/app-auth.service.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed } from '@angular/core/testing'; 2 | 3 | import { AppAuthService } from './app-auth.service'; 4 | 5 | describe('AppAuthService', () => { 6 | beforeEach(() => TestBed.configureTestingModule({})); 7 | 8 | it('should be created', () => { 9 | const service: AppAuthService = TestBed.get(AppAuthService); 10 | expect(service).toBeTruthy(); 11 | }); 12 | }); 13 | -------------------------------------------------------------------------------- /Chapter14/chapter14-firebase-app/src/app/app.component.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Angular-and-Bootstrap-Third-Edition/6d52dea530bc0835c7ec648c746aa5826cab48a9/Chapter14/chapter14-firebase-app/src/app/app.component.scss -------------------------------------------------------------------------------- /Chapter14/chapter14-firebase-app/src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | import { AppAuthService } from './app-auth.service'; 3 | 4 | @Component({ 5 | selector: 'app-root', 6 | templateUrl: './app.component.html', 7 | styleUrls: ['./app.component.scss'] 8 | }) 9 | export class AppComponent { 10 | title = 'AutoStop'; 11 | 12 | constructor(private _appAuthService : AppAuthService) { } 13 | 14 | } 15 | -------------------------------------------------------------------------------- /Chapter14/chapter14-firebase-app/src/app/custom-form-validation/custom-form-validation.component.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Angular-and-Bootstrap-Third-Edition/6d52dea530bc0835c7ec648c746aa5826cab48a9/Chapter14/chapter14-firebase-app/src/app/custom-form-validation/custom-form-validation.component.scss -------------------------------------------------------------------------------- /Chapter14/chapter14-firebase-app/src/app/login/login.component.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Angular-and-Bootstrap-Third-Edition/6d52dea530bc0835c7ec648c746aa5826cab48a9/Chapter14/chapter14-firebase-app/src/app/login/login.component.scss -------------------------------------------------------------------------------- /Chapter14/chapter14-firebase-app/src/app/logout/logout.component.html: -------------------------------------------------------------------------------- 1 |

2 | logout works! 3 |

4 | -------------------------------------------------------------------------------- /Chapter14/chapter14-firebase-app/src/app/logout/logout.component.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Angular-and-Bootstrap-Third-Edition/6d52dea530bc0835c7ec648c746aa5826cab48a9/Chapter14/chapter14-firebase-app/src/app/logout/logout.component.scss -------------------------------------------------------------------------------- /Chapter14/chapter14-firebase-app/src/app/profile/profile.component.html: -------------------------------------------------------------------------------- 1 |
2 |

3 | profile works! 4 |

5 | 6 | User Token is {{_appAuthService.userToken}} 7 |
-------------------------------------------------------------------------------- /Chapter14/chapter14-firebase-app/src/app/profile/profile.component.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Angular-and-Bootstrap-Third-Edition/6d52dea530bc0835c7ec648c746aa5826cab48a9/Chapter14/chapter14-firebase-app/src/app/profile/profile.component.scss -------------------------------------------------------------------------------- /Chapter14/chapter14-firebase-app/src/app/profile/profile.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import { AppAuthService } from '../app-auth.service'; 3 | 4 | @Component({ 5 | selector: 'app-profile', 6 | templateUrl: './profile.component.html', 7 | styleUrls: ['./profile.component.scss'] 8 | }) 9 | export class ProfileComponent implements OnInit { 10 | 11 | constructor(private _appAuthService : AppAuthService) { } 12 | 13 | ngOnInit() { 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /Chapter14/chapter14-firebase-app/src/app/valid-isbn.directive.spec.ts: -------------------------------------------------------------------------------- 1 | import { ValidISBNDirective } from './valid-isbn.directive'; 2 | 3 | describe('ValidISBNDirective', () => { 4 | it('should create an instance', () => { 5 | const directive = new ValidISBNDirective(); 6 | expect(directive).toBeTruthy(); 7 | }); 8 | }); 9 | -------------------------------------------------------------------------------- /Chapter14/chapter14-firebase-app/src/assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Angular-and-Bootstrap-Third-Edition/6d52dea530bc0835c7ec648c746aa5826cab48a9/Chapter14/chapter14-firebase-app/src/assets/.gitkeep -------------------------------------------------------------------------------- /Chapter14/chapter14-firebase-app/src/browserslist: -------------------------------------------------------------------------------- 1 | # This file is currently used by autoprefixer to adjust CSS to support the below specified browsers 2 | # For additional information regarding the format and rule options, please see: 3 | # https://github.com/browserslist/browserslist#queries 4 | # 5 | # For IE 9-11 support, please remove 'not' from the last line of the file and adjust as needed 6 | 7 | > 0.5% 8 | last 2 versions 9 | Firefox ESR 10 | not dead 11 | not IE 9-11 -------------------------------------------------------------------------------- /Chapter14/chapter14-firebase-app/src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true 3 | }; 4 | -------------------------------------------------------------------------------- /Chapter14/chapter14-firebase-app/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Angular-and-Bootstrap-Third-Edition/6d52dea530bc0835c7ec648c746aa5826cab48a9/Chapter14/chapter14-firebase-app/src/favicon.ico -------------------------------------------------------------------------------- /Chapter14/chapter14-firebase-app/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | AngularFirebaseApp 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /Chapter14/chapter14-firebase-app/src/main.ts: -------------------------------------------------------------------------------- 1 | import { enableProdMode } from '@angular/core'; 2 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 3 | 4 | import { AppModule } from './app/app.module'; 5 | import { environment } from './environments/environment'; 6 | 7 | if (environment.production) { 8 | enableProdMode(); 9 | } 10 | 11 | platformBrowserDynamic().bootstrapModule(AppModule) 12 | .catch(err => console.error(err)); 13 | -------------------------------------------------------------------------------- /Chapter14/chapter14-firebase-app/src/styles.scss: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | -------------------------------------------------------------------------------- /Chapter14/chapter14-firebase-app/src/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/app", 5 | "types": [] 6 | }, 7 | "exclude": [ 8 | "test.ts", 9 | "**/*.spec.ts" 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /Chapter14/chapter14-firebase-app/src/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/spec", 5 | "types": [ 6 | "jasmine", 7 | "node" 8 | ] 9 | }, 10 | "files": [ 11 | "test.ts", 12 | "polyfills.ts" 13 | ], 14 | "include": [ 15 | "**/*.spec.ts", 16 | "**/*.d.ts" 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /Chapter14/chapter14-firebase-app/src/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tslint.json", 3 | "rules": { 4 | "directive-selector": [ 5 | true, 6 | "attribute", 7 | "app", 8 | "camelCase" 9 | ], 10 | "component-selector": [ 11 | true, 12 | "element", 13 | "app", 14 | "kebab-case" 15 | ] 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Chapter14/chapter14_auth0/.editorconfig: -------------------------------------------------------------------------------- 1 | # Editor configuration, see https://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 | -------------------------------------------------------------------------------- /Chapter14/chapter14_auth0/e2e/src/app.e2e-spec.ts: -------------------------------------------------------------------------------- 1 | import { AppPage } from './app.po'; 2 | 3 | describe('workspace-project App', () => { 4 | let page: AppPage; 5 | 6 | beforeEach(() => { 7 | page = new AppPage(); 8 | }); 9 | 10 | it('should display welcome message', () => { 11 | page.navigateTo(); 12 | expect(page.getTitleText()).toEqual('Welcome to authentication-with-auth0!'); 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /Chapter14/chapter14_auth0/e2e/src/app.po.ts: -------------------------------------------------------------------------------- 1 | import { browser, by, element } from 'protractor'; 2 | 3 | export class AppPage { 4 | navigateTo() { 5 | return browser.get('/'); 6 | } 7 | 8 | getTitleText() { 9 | return element(by.css('app-root h1')).getText(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Chapter14/chapter14_auth0/e2e/tsconfig.e2e.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/app", 5 | "module": "commonjs", 6 | "target": "es5", 7 | "types": [ 8 | "jasmine", 9 | "jasminewd2", 10 | "node" 11 | ] 12 | } 13 | } -------------------------------------------------------------------------------- /Chapter14/chapter14_auth0/src/app/app-routing.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { Routes, RouterModule } from '@angular/router'; 3 | 4 | const routes: Routes = []; 5 | 6 | @NgModule({ 7 | imports: [RouterModule.forRoot(routes)], 8 | exports: [RouterModule] 9 | }) 10 | export class AppRoutingModule { } 11 | -------------------------------------------------------------------------------- /Chapter14/chapter14_auth0/src/app/app.component.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Angular-and-Bootstrap-Third-Edition/6d52dea530bc0835c7ec648c746aa5826cab48a9/Chapter14/chapter14_auth0/src/app/app.component.scss -------------------------------------------------------------------------------- /Chapter14/chapter14_auth0/src/app/login/login.component.html: -------------------------------------------------------------------------------- 1 |

2 | login works! 3 |

4 | -------------------------------------------------------------------------------- /Chapter14/chapter14_auth0/src/app/login/login.component.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Angular-and-Bootstrap-Third-Edition/6d52dea530bc0835c7ec648c746aa5826cab48a9/Chapter14/chapter14_auth0/src/app/login/login.component.scss -------------------------------------------------------------------------------- /Chapter14/chapter14_auth0/src/app/login/login.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-login', 5 | templateUrl: './login.component.html', 6 | styleUrls: ['./login.component.scss'] 7 | }) 8 | export class LoginComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /Chapter14/chapter14_auth0/src/app/profile/profile.component.html: -------------------------------------------------------------------------------- 1 |

2 | profile works! 3 |

4 | -------------------------------------------------------------------------------- /Chapter14/chapter14_auth0/src/app/profile/profile.component.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Angular-and-Bootstrap-Third-Edition/6d52dea530bc0835c7ec648c746aa5826cab48a9/Chapter14/chapter14_auth0/src/app/profile/profile.component.scss -------------------------------------------------------------------------------- /Chapter14/chapter14_auth0/src/app/profile/profile.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-profile', 5 | templateUrl: './profile.component.html', 6 | styleUrls: ['./profile.component.scss'] 7 | }) 8 | export class ProfileComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /Chapter14/chapter14_auth0/src/app/services/auth.service.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed } from '@angular/core/testing'; 2 | 3 | import { AuthService } from './auth.service'; 4 | 5 | describe('AuthService', () => { 6 | beforeEach(() => TestBed.configureTestingModule({})); 7 | 8 | it('should be created', () => { 9 | const service: AuthService = TestBed.get(AuthService); 10 | expect(service).toBeTruthy(); 11 | }); 12 | }); 13 | -------------------------------------------------------------------------------- /Chapter14/chapter14_auth0/src/assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Angular-and-Bootstrap-Third-Edition/6d52dea530bc0835c7ec648c746aa5826cab48a9/Chapter14/chapter14_auth0/src/assets/.gitkeep -------------------------------------------------------------------------------- /Chapter14/chapter14_auth0/src/browserslist: -------------------------------------------------------------------------------- 1 | # This file is currently used by autoprefixer to adjust CSS to support the below specified browsers 2 | # For additional information regarding the format and rule options, please see: 3 | # https://github.com/browserslist/browserslist#queries 4 | # 5 | # For IE 9-11 support, please remove 'not' from the last line of the file and adjust as needed 6 | 7 | > 0.5% 8 | last 2 versions 9 | Firefox ESR 10 | not dead 11 | not IE 9-11 -------------------------------------------------------------------------------- /Chapter14/chapter14_auth0/src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true 3 | }; 4 | -------------------------------------------------------------------------------- /Chapter14/chapter14_auth0/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Angular-and-Bootstrap-Third-Edition/6d52dea530bc0835c7ec648c746aa5826cab48a9/Chapter14/chapter14_auth0/src/favicon.ico -------------------------------------------------------------------------------- /Chapter14/chapter14_auth0/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | AuthenticationWithAuth0 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /Chapter14/chapter14_auth0/src/main.ts: -------------------------------------------------------------------------------- 1 | import { enableProdMode } from '@angular/core'; 2 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 3 | 4 | import { AppModule } from './app/app.module'; 5 | import { environment } from './environments/environment'; 6 | 7 | if (environment.production) { 8 | enableProdMode(); 9 | } 10 | 11 | platformBrowserDynamic().bootstrapModule(AppModule) 12 | .catch(err => console.error(err)); 13 | -------------------------------------------------------------------------------- /Chapter14/chapter14_auth0/src/styles.scss: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | -------------------------------------------------------------------------------- /Chapter14/chapter14_auth0/src/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/app", 5 | "types": [] 6 | }, 7 | "exclude": [ 8 | "test.ts", 9 | "**/*.spec.ts" 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /Chapter14/chapter14_auth0/src/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/spec", 5 | "types": [ 6 | "jasmine", 7 | "node" 8 | ] 9 | }, 10 | "files": [ 11 | "test.ts", 12 | "polyfills.ts" 13 | ], 14 | "include": [ 15 | "**/*.spec.ts", 16 | "**/*.d.ts" 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /Chapter14/chapter14_auth0/src/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tslint.json", 3 | "rules": { 4 | "directive-selector": [ 5 | true, 6 | "attribute", 7 | "app", 8 | "camelCase" 9 | ], 10 | "component-selector": [ 11 | true, 12 | "element", 13 | "app", 14 | "kebab-case" 15 | ] 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Chapter14/chapter14_part1/.editorconfig: -------------------------------------------------------------------------------- 1 | # Editor configuration, see https://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 | -------------------------------------------------------------------------------- /Chapter14/chapter14_part1/e2e/src/app.e2e-spec.ts: -------------------------------------------------------------------------------- 1 | import { AppPage } from './app.po'; 2 | 3 | describe('workspace-project App', () => { 4 | let page: AppPage; 5 | 6 | beforeEach(() => { 7 | page = new AppPage(); 8 | }); 9 | 10 | it('should display welcome message', () => { 11 | page.navigateTo(); 12 | expect(page.getTitleText()).toEqual('Welcome to custom-directive!'); 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /Chapter14/chapter14_part1/e2e/src/app.po.ts: -------------------------------------------------------------------------------- 1 | import { browser, by, element } from 'protractor'; 2 | 3 | export class AppPage { 4 | navigateTo() { 5 | return browser.get('/'); 6 | } 7 | 8 | getTitleText() { 9 | return element(by.css('app-root h1')).getText(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Chapter14/chapter14_part1/e2e/tsconfig.e2e.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/app", 5 | "module": "commonjs", 6 | "target": "es5", 7 | "types": [ 8 | "jasmine", 9 | "jasminewd2", 10 | "node" 11 | ] 12 | } 13 | } -------------------------------------------------------------------------------- /Chapter14/chapter14_part1/src/app/app-routing.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { Routes, RouterModule } from '@angular/router'; 3 | 4 | const routes: Routes = []; 5 | 6 | @NgModule({ 7 | imports: [RouterModule.forRoot(routes)], 8 | exports: [RouterModule] 9 | }) 10 | export class AppRoutingModule { } 11 | -------------------------------------------------------------------------------- /Chapter14/chapter14_part1/src/app/app.component.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Angular-and-Bootstrap-Third-Edition/6d52dea530bc0835c7ec648c746aa5826cab48a9/Chapter14/chapter14_part1/src/app/app.component.scss -------------------------------------------------------------------------------- /Chapter14/chapter14_part1/src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | import { FormGroup, FormBuilder, Validators, FormControl } from '@angular/forms'; 3 | 4 | @Component({ 5 | selector: 'app-root', 6 | templateUrl: './app.component.html', 7 | styleUrls: ['./app.component.scss'] 8 | }) 9 | export class AppComponent { 10 | title = 'custom-directive'; 11 | 12 | } 13 | -------------------------------------------------------------------------------- /Chapter14/chapter14_part1/src/app/custom-form-validator.ts: -------------------------------------------------------------------------------- 1 | import { FormControl } from '@angular/forms'; 2 | 3 | export class CustomFormValidator { 4 | static validOrderId(fc: FormControl){ 5 | 6 | const expr = /[-\\\/]/; 7 | if(fc.value.toLowerCase() === "abc123" || fc.value.toLowerCase() === "123abc"){ 8 | return ({validOrderId: true}); 9 | } else { 10 | return (null); 11 | } 12 | } 13 | } -------------------------------------------------------------------------------- /Chapter14/chapter14_part1/src/app/on-focus-blur.directive.spec.ts: -------------------------------------------------------------------------------- 1 | import { OnFocusBlurDirective } from './on-focus-blur.directive'; 2 | 3 | describe('OnFocusBlurDirective', () => { 4 | it('should create an instance', () => { 5 | const directive = new OnFocusBlurDirective(); 6 | expect(directive).toBeTruthy(); 7 | }); 8 | }); 9 | -------------------------------------------------------------------------------- /Chapter14/chapter14_part1/src/assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Angular-and-Bootstrap-Third-Edition/6d52dea530bc0835c7ec648c746aa5826cab48a9/Chapter14/chapter14_part1/src/assets/.gitkeep -------------------------------------------------------------------------------- /Chapter14/chapter14_part1/src/browserslist: -------------------------------------------------------------------------------- 1 | # This file is currently used by autoprefixer to adjust CSS to support the below specified browsers 2 | # For additional information regarding the format and rule options, please see: 3 | # https://github.com/browserslist/browserslist#queries 4 | # 5 | # For IE 9-11 support, please remove 'not' from the last line of the file and adjust as needed 6 | 7 | > 0.5% 8 | last 2 versions 9 | Firefox ESR 10 | not dead 11 | not IE 9-11 -------------------------------------------------------------------------------- /Chapter14/chapter14_part1/src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true 3 | }; 4 | -------------------------------------------------------------------------------- /Chapter14/chapter14_part1/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Angular-and-Bootstrap-Third-Edition/6d52dea530bc0835c7ec648c746aa5826cab48a9/Chapter14/chapter14_part1/src/favicon.ico -------------------------------------------------------------------------------- /Chapter14/chapter14_part1/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CustomDirective 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /Chapter14/chapter14_part1/src/main.ts: -------------------------------------------------------------------------------- 1 | import { enableProdMode } from '@angular/core'; 2 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 3 | 4 | import { AppModule } from './app/app.module'; 5 | import { environment } from './environments/environment'; 6 | 7 | if (environment.production) { 8 | enableProdMode(); 9 | } 10 | 11 | platformBrowserDynamic().bootstrapModule(AppModule) 12 | .catch(err => console.error(err)); 13 | -------------------------------------------------------------------------------- /Chapter14/chapter14_part1/src/styles.scss: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | -------------------------------------------------------------------------------- /Chapter14/chapter14_part1/src/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/app", 5 | "types": [] 6 | }, 7 | "exclude": [ 8 | "test.ts", 9 | "**/*.spec.ts" 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /Chapter14/chapter14_part1/src/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/spec", 5 | "types": [ 6 | "jasmine", 7 | "node" 8 | ] 9 | }, 10 | "files": [ 11 | "test.ts", 12 | "polyfills.ts" 13 | ], 14 | "include": [ 15 | "**/*.spec.ts", 16 | "**/*.d.ts" 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /Chapter14/chapter14_part1/src/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tslint.json", 3 | "rules": { 4 | "directive-selector": [ 5 | true, 6 | "attribute", 7 | "app", 8 | "camelCase" 9 | ], 10 | "component-selector": [ 11 | true, 12 | "element", 13 | "app", 14 | "kebab-case" 15 | ] 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Chapter15/chapter15_part1/.editorconfig: -------------------------------------------------------------------------------- 1 | # Editor configuration, see https://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 | -------------------------------------------------------------------------------- /Chapter15/chapter15_part1/e2e/src/app.e2e-spec.ts: -------------------------------------------------------------------------------- 1 | import { AppPage } from './app.po'; 2 | 3 | describe('workspace-project App', () => { 4 | let page: AppPage; 5 | 6 | beforeEach(() => { 7 | page = new AppPage(); 8 | }); 9 | 10 | it('should display welcome message', () => { 11 | page.navigateTo(); 12 | expect(page.getTitleText()).toEqual('Welcome to prod-ready!'); 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /Chapter15/chapter15_part1/e2e/src/app.po.ts: -------------------------------------------------------------------------------- 1 | import { browser, by, element } from 'protractor'; 2 | 3 | export class AppPage { 4 | navigateTo() { 5 | return browser.get('/'); 6 | } 7 | 8 | getTitleText() { 9 | return element(by.css('app-root h1')).getText(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Chapter15/chapter15_part1/e2e/tsconfig.e2e.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/app", 5 | "module": "commonjs", 6 | "target": "es5", 7 | "types": [ 8 | "jasmine", 9 | "jasminewd2", 10 | "node" 11 | ] 12 | } 13 | } -------------------------------------------------------------------------------- /Chapter15/chapter15_part1/src/app/app-routing.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { Routes, RouterModule } from '@angular/router'; 3 | import {ListImagesComponent} from './list-images/list-images.component'; 4 | const routes: Routes = [ 5 | { 6 | path:'list-images', 7 | component:ListImagesComponent 8 | } 9 | ]; 10 | 11 | @NgModule({ 12 | imports: [RouterModule.forRoot(routes)], 13 | exports: [RouterModule] 14 | }) 15 | export class AppRoutingModule { } 16 | -------------------------------------------------------------------------------- /Chapter15/chapter15_part1/src/app/app.component.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /Chapter15/chapter15_part1/src/app/app.component.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Angular-and-Bootstrap-Third-Edition/6d52dea530bc0835c7ec648c746aa5826cab48a9/Chapter15/chapter15_part1/src/app/app.component.scss -------------------------------------------------------------------------------- /Chapter15/chapter15_part1/src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-root', 5 | templateUrl: './app.component.html', 6 | styleUrls: ['./app.component.scss'] 7 | }) 8 | export class AppComponent { 9 | title = 'prod-ready'; 10 | } 11 | -------------------------------------------------------------------------------- /Chapter15/chapter15_part1/src/app/brands.ts: -------------------------------------------------------------------------------- 1 | export class Brands { 2 | id: number; 3 | name: string; 4 | url: string; 5 | } -------------------------------------------------------------------------------- /Chapter15/chapter15_part1/src/app/cars/cars.component.html: -------------------------------------------------------------------------------- 1 | 2 |
    3 |
  • 4 | {{ brand.name}} 5 |
  • 6 |
-------------------------------------------------------------------------------- /Chapter15/chapter15_part1/src/app/cars/cars.component.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Angular-and-Bootstrap-Third-Edition/6d52dea530bc0835c7ec648c746aa5826cab48a9/Chapter15/chapter15_part1/src/app/cars/cars.component.scss -------------------------------------------------------------------------------- /Chapter15/chapter15_part1/src/app/list-images/list-images.component.html: -------------------------------------------------------------------------------- 1 |

2 | list-images works! 3 |

4 | 5 | -------------------------------------------------------------------------------- /Chapter15/chapter15_part1/src/app/list-images/list-images.component.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Angular-and-Bootstrap-Third-Edition/6d52dea530bc0835c7ec648c746aa5826cab48a9/Chapter15/chapter15_part1/src/app/list-images/list-images.component.scss -------------------------------------------------------------------------------- /Chapter15/chapter15_part1/src/app/testing-di/images.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | 3 | @Injectable({ 4 | providedIn: 'root' 5 | }) 6 | export class ImagesService { 7 | 8 | constructor() { } 9 | 10 | getImageSourcesCount() { 11 | 12 | let sources = [ 13 | {outlet : 'NYTimes'}, 14 | {outlet : 'Google'}, 15 | {outlet : 'Huffington Post'}, 16 | {outlet : 'Yahoo'}, 17 | ]; 18 | return sources; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Chapter15/chapter15_part1/src/app/vehicles.service.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed } from '@angular/core/testing'; 2 | 3 | import { VehiclesService } from './vehicles.service'; 4 | 5 | describe('VehiclesService', () => { 6 | beforeEach(() => TestBed.configureTestingModule({})); 7 | 8 | it('should be created', () => { 9 | const service: VehiclesService = TestBed.get(VehiclesService); 10 | expect(service).toBeTruthy(); 11 | }); 12 | }); 13 | -------------------------------------------------------------------------------- /Chapter15/chapter15_part1/src/assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Angular-and-Bootstrap-Third-Edition/6d52dea530bc0835c7ec648c746aa5826cab48a9/Chapter15/chapter15_part1/src/assets/.gitkeep -------------------------------------------------------------------------------- /Chapter15/chapter15_part1/src/browserslist: -------------------------------------------------------------------------------- 1 | # This file is currently used by autoprefixer to adjust CSS to support the below specified browsers 2 | # For additional information regarding the format and rule options, please see: 3 | # https://github.com/browserslist/browserslist#queries 4 | # 5 | # For IE 9-11 support, please remove 'not' from the last line of the file and adjust as needed 6 | 7 | > 0.5% 8 | last 2 versions 9 | Firefox ESR 10 | not dead 11 | not IE 9-11 -------------------------------------------------------------------------------- /Chapter15/chapter15_part1/src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true 3 | }; 4 | -------------------------------------------------------------------------------- /Chapter15/chapter15_part1/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Angular-and-Bootstrap-Third-Edition/6d52dea530bc0835c7ec648c746aa5826cab48a9/Chapter15/chapter15_part1/src/favicon.ico -------------------------------------------------------------------------------- /Chapter15/chapter15_part1/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | ProdReady 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /Chapter15/chapter15_part1/src/main.ts: -------------------------------------------------------------------------------- 1 | import { enableProdMode } from '@angular/core'; 2 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 3 | 4 | import { AppModule } from './app/app.module'; 5 | import { environment } from './environments/environment'; 6 | 7 | if (environment.production) { 8 | enableProdMode(); 9 | } 10 | 11 | platformBrowserDynamic().bootstrapModule(AppModule) 12 | .catch(err => console.error(err)); 13 | -------------------------------------------------------------------------------- /Chapter15/chapter15_part1/src/styles.scss: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | @import "../node_modules/bootstrap/dist/css/bootstrap.css"; -------------------------------------------------------------------------------- /Chapter15/chapter15_part1/src/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/app", 5 | "types": [] 6 | }, 7 | "exclude": [ 8 | "test.ts", 9 | "**/*.spec.ts" 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /Chapter15/chapter15_part1/src/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/spec", 5 | "types": [ 6 | "jasmine", 7 | "node" 8 | ] 9 | }, 10 | "files": [ 11 | "test.ts", 12 | "polyfills.ts" 13 | ], 14 | "include": [ 15 | "**/*.spec.ts", 16 | "**/*.d.ts" 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /Chapter15/chapter15_part1/src/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tslint.json", 3 | "rules": { 4 | "directive-selector": [ 5 | true, 6 | "attribute", 7 | "app", 8 | "camelCase" 9 | ], 10 | "component-selector": [ 11 | true, 12 | "element", 13 | "app", 14 | "kebab-case" 15 | ] 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Chapter15/chapter_15_deploying_angular_part2/.editorconfig: -------------------------------------------------------------------------------- 1 | # Editor configuration, see https://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 | -------------------------------------------------------------------------------- /Chapter15/chapter_15_deploying_angular_part2/e2e/src/app.e2e-spec.ts: -------------------------------------------------------------------------------- 1 | import { AppPage } from './app.po'; 2 | 3 | describe('workspace-project App', () => { 4 | let page: AppPage; 5 | 6 | beforeEach(() => { 7 | page = new AppPage(); 8 | }); 9 | 10 | it('should display welcome message', () => { 11 | page.navigateTo(); 12 | expect(page.getTitleText()).toEqual('Welcome to shopping-cart!'); 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /Chapter15/chapter_15_deploying_angular_part2/e2e/src/app.po.ts: -------------------------------------------------------------------------------- 1 | import { browser, by, element } from 'protractor'; 2 | 3 | export class AppPage { 4 | navigateTo() { 5 | return browser.get('/'); 6 | } 7 | 8 | getTitleText() { 9 | return element(by.css('app-root h1')).getText(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Chapter15/chapter_15_deploying_angular_part2/e2e/tsconfig.e2e.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/app", 5 | "module": "commonjs", 6 | "target": "es5", 7 | "types": [ 8 | "jasmine", 9 | "jasminewd2", 10 | "node" 11 | ] 12 | } 13 | } -------------------------------------------------------------------------------- /Chapter15/chapter_15_deploying_angular_part2/projects/jackets-e2e/src/app.e2e-spec.ts: -------------------------------------------------------------------------------- 1 | import { AppPage } from './app.po'; 2 | 3 | describe('workspace-project App', () => { 4 | let page: AppPage; 5 | 6 | beforeEach(() => { 7 | page = new AppPage(); 8 | }); 9 | 10 | it('should display welcome message', () => { 11 | page.navigateTo(); 12 | expect(page.getTitleText()).toEqual('Welcome to jackets!'); 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /Chapter15/chapter_15_deploying_angular_part2/projects/jackets-e2e/src/app.po.ts: -------------------------------------------------------------------------------- 1 | import { browser, by, element } from 'protractor'; 2 | 3 | export class AppPage { 4 | navigateTo() { 5 | return browser.get('/'); 6 | } 7 | 8 | getTitleText() { 9 | return element(by.css('app-root h1')).getText(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Chapter15/chapter_15_deploying_angular_part2/projects/jackets-e2e/tsconfig.e2e.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../out-tsc/app", 5 | "module": "commonjs", 6 | "target": "es5", 7 | "types": [ 8 | "jasmine", 9 | "jasminewd2", 10 | "node" 11 | ] 12 | } 13 | } -------------------------------------------------------------------------------- /Chapter15/chapter_15_deploying_angular_part2/projects/jackets/browserslist: -------------------------------------------------------------------------------- 1 | # This file is currently used by autoprefixer to adjust CSS to support the below specified browsers 2 | # For additional information regarding the format and rule options, please see: 3 | # https://github.com/browserslist/browserslist#queries 4 | # 5 | # For IE 9-11 support, please remove 'not' from the last line of the file and adjust as needed 6 | 7 | > 0.5% 8 | last 2 versions 9 | Firefox ESR 10 | not dead 11 | not IE 9-11 -------------------------------------------------------------------------------- /Chapter15/chapter_15_deploying_angular_part2/projects/jackets/src/app/app.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Angular-and-Bootstrap-Third-Edition/6d52dea530bc0835c7ec648c746aa5826cab48a9/Chapter15/chapter_15_deploying_angular_part2/projects/jackets/src/app/app.component.css -------------------------------------------------------------------------------- /Chapter15/chapter_15_deploying_angular_part2/projects/jackets/src/app/app.component.html: -------------------------------------------------------------------------------- 1 | 2 |
3 |

4 | Welcome to {{title}} Component 5 |

6 |
7 | -------------------------------------------------------------------------------- /Chapter15/chapter_15_deploying_angular_part2/projects/jackets/src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-root', 5 | templateUrl: './app.component.html', 6 | styleUrls: ['./app.component.css'] 7 | }) 8 | export class AppComponent { 9 | title = 'jackets'; 10 | } 11 | -------------------------------------------------------------------------------- /Chapter15/chapter_15_deploying_angular_part2/projects/jackets/src/app/app.module.ts: -------------------------------------------------------------------------------- 1 | import { BrowserModule } from '@angular/platform-browser'; 2 | import { NgModule } from '@angular/core'; 3 | 4 | import { AppComponent } from './app.component'; 5 | 6 | @NgModule({ 7 | declarations: [ 8 | AppComponent 9 | ], 10 | imports: [ 11 | BrowserModule 12 | ], 13 | providers: [], 14 | bootstrap: [AppComponent] 15 | }) 16 | export class AppModule { } 17 | -------------------------------------------------------------------------------- /Chapter15/chapter_15_deploying_angular_part2/projects/jackets/src/app/jacket-list/jacket-list.component.html: -------------------------------------------------------------------------------- 1 |

2 | jacket-list works! 3 |

4 | -------------------------------------------------------------------------------- /Chapter15/chapter_15_deploying_angular_part2/projects/jackets/src/app/jacket-list/jacket-list.component.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Angular-and-Bootstrap-Third-Edition/6d52dea530bc0835c7ec648c746aa5826cab48a9/Chapter15/chapter_15_deploying_angular_part2/projects/jackets/src/app/jacket-list/jacket-list.component.scss -------------------------------------------------------------------------------- /Chapter15/chapter_15_deploying_angular_part2/projects/jackets/src/app/jacket-list/jacket-list.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-jacket-list', 5 | templateUrl: './jacket-list.component.html', 6 | styleUrls: ['./jacket-list.component.scss'] 7 | }) 8 | export class JacketListComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /Chapter15/chapter_15_deploying_angular_part2/projects/jackets/src/assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Angular-and-Bootstrap-Third-Edition/6d52dea530bc0835c7ec648c746aa5826cab48a9/Chapter15/chapter_15_deploying_angular_part2/projects/jackets/src/assets/.gitkeep -------------------------------------------------------------------------------- /Chapter15/chapter_15_deploying_angular_part2/projects/jackets/src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true 3 | }; 4 | -------------------------------------------------------------------------------- /Chapter15/chapter_15_deploying_angular_part2/projects/jackets/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Angular-and-Bootstrap-Third-Edition/6d52dea530bc0835c7ec648c746aa5826cab48a9/Chapter15/chapter_15_deploying_angular_part2/projects/jackets/src/favicon.ico -------------------------------------------------------------------------------- /Chapter15/chapter_15_deploying_angular_part2/projects/jackets/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Jackets 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /Chapter15/chapter_15_deploying_angular_part2/projects/jackets/src/main.ts: -------------------------------------------------------------------------------- 1 | import { enableProdMode } from '@angular/core'; 2 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 3 | 4 | import { AppModule } from './app/app.module'; 5 | import { environment } from './environments/environment'; 6 | 7 | if (environment.production) { 8 | enableProdMode(); 9 | } 10 | 11 | platformBrowserDynamic().bootstrapModule(AppModule) 12 | .catch(err => console.error(err)); 13 | -------------------------------------------------------------------------------- /Chapter15/chapter_15_deploying_angular_part2/projects/jackets/src/styles.css: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | -------------------------------------------------------------------------------- /Chapter15/chapter_15_deploying_angular_part2/projects/jackets/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../out-tsc/app", 5 | "types": [] 6 | }, 7 | "exclude": [ 8 | "test.ts", 9 | "**/*.spec.ts" 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /Chapter15/chapter_15_deploying_angular_part2/projects/jackets/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../out-tsc/spec", 5 | "types": [ 6 | "jasmine", 7 | "node" 8 | ] 9 | }, 10 | "files": [ 11 | "src/test.ts", 12 | "src/polyfills.ts" 13 | ], 14 | "include": [ 15 | "**/*.spec.ts", 16 | "**/*.d.ts" 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /Chapter15/chapter_15_deploying_angular_part2/projects/jackets/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tslint.json", 3 | "rules": { 4 | "directive-selector": [ 5 | true, 6 | "attribute", 7 | "app", 8 | "camelCase" 9 | ], 10 | "component-selector": [ 11 | true, 12 | "element", 13 | "app", 14 | "kebab-case" 15 | ] 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Chapter15/chapter_15_deploying_angular_part2/projects/vendors/ng-package.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "../../node_modules/ng-packagr/ng-package.schema.json", 3 | "dest": "../../dist/vendors", 4 | "lib": { 5 | "entryFile": "src/projects.ts" 6 | } 7 | } -------------------------------------------------------------------------------- /Chapter15/chapter_15_deploying_angular_part2/projects/vendors/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "vendors", 3 | "version": "0.0.1", 4 | "peerDependencies": { 5 | "@angular/common": "^7.1.0", 6 | "@angular/core": "^7.1.0" 7 | } 8 | } -------------------------------------------------------------------------------- /Chapter15/chapter_15_deploying_angular_part2/projects/vendors/src/lib/vendors.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'my-vendors', 5 | template: ` 6 |

7 | vendors works! 8 |

9 | `, 10 | styles: [] 11 | }) 12 | export class VendorsComponent implements OnInit { 13 | 14 | constructor() { } 15 | 16 | ngOnInit() { 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /Chapter15/chapter_15_deploying_angular_part2/projects/vendors/src/lib/vendors.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { VendorsComponent } from './vendors.component'; 3 | 4 | @NgModule({ 5 | declarations: [VendorsComponent], 6 | imports: [ 7 | ], 8 | exports: [VendorsComponent] 9 | }) 10 | export class VendorsModule { } 11 | -------------------------------------------------------------------------------- /Chapter15/chapter_15_deploying_angular_part2/projects/vendors/src/lib/vendors.service.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed } from '@angular/core/testing'; 2 | 3 | import { VendorsService } from './vendors.service'; 4 | 5 | describe('VendorsService', () => { 6 | beforeEach(() => TestBed.configureTestingModule({})); 7 | 8 | it('should be created', () => { 9 | const service: VendorsService = TestBed.get(VendorsService); 10 | expect(service).toBeTruthy(); 11 | }); 12 | }); 13 | -------------------------------------------------------------------------------- /Chapter15/chapter_15_deploying_angular_part2/projects/vendors/src/lib/vendors.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | 3 | @Injectable({ 4 | providedIn: 'root' 5 | }) 6 | export class VendorsService { 7 | 8 | constructor() { } 9 | } 10 | -------------------------------------------------------------------------------- /Chapter15/chapter_15_deploying_angular_part2/projects/vendors/src/projects.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Public API Surface of vendors 3 | */ 4 | 5 | export * from './lib/vendors.service'; 6 | export * from './lib/vendors.component'; 7 | export * from './lib/vendors.module'; 8 | -------------------------------------------------------------------------------- /Chapter15/chapter_15_deploying_angular_part2/projects/vendors/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../out-tsc/spec", 5 | "types": [ 6 | "jasmine", 7 | "node" 8 | ] 9 | }, 10 | "files": [ 11 | "src/test.ts" 12 | ], 13 | "include": [ 14 | "**/*.spec.ts", 15 | "**/*.d.ts" 16 | ] 17 | } 18 | -------------------------------------------------------------------------------- /Chapter15/chapter_15_deploying_angular_part2/projects/vendors/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tslint.json", 3 | "rules": { 4 | "directive-selector": [ 5 | true, 6 | "attribute", 7 | "my", 8 | "camelCase" 9 | ], 10 | "component-selector": [ 11 | true, 12 | "element", 13 | "my", 14 | "kebab-case" 15 | ] 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Chapter15/chapter_15_deploying_angular_part2/src/app/app.component.html: -------------------------------------------------------------------------------- 1 | 2 |
3 |

4 | Welcome to {{ title }}! 5 |

6 |
7 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /Chapter15/chapter_15_deploying_angular_part2/src/app/app.component.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Angular-and-Bootstrap-Third-Edition/6d52dea530bc0835c7ec648c746aa5826cab48a9/Chapter15/chapter_15_deploying_angular_part2/src/app/app.component.scss -------------------------------------------------------------------------------- /Chapter15/chapter_15_deploying_angular_part2/src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-root', 5 | templateUrl: './app.component.html', 6 | styleUrls: ['./app.component.scss'] 7 | }) 8 | export class AppComponent { 9 | title = 'shopping-cart'; 10 | } 11 | -------------------------------------------------------------------------------- /Chapter15/chapter_15_deploying_angular_part2/src/assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Angular-and-Bootstrap-Third-Edition/6d52dea530bc0835c7ec648c746aa5826cab48a9/Chapter15/chapter_15_deploying_angular_part2/src/assets/.gitkeep -------------------------------------------------------------------------------- /Chapter15/chapter_15_deploying_angular_part2/src/browserslist: -------------------------------------------------------------------------------- 1 | # This file is currently used by autoprefixer to adjust CSS to support the below specified browsers 2 | # For additional information regarding the format and rule options, please see: 3 | # https://github.com/browserslist/browserslist#queries 4 | # 5 | # For IE 9-11 support, please remove 'not' from the last line of the file and adjust as needed 6 | 7 | > 0.5% 8 | last 2 versions 9 | Firefox ESR 10 | not dead 11 | not IE 9-11 -------------------------------------------------------------------------------- /Chapter15/chapter_15_deploying_angular_part2/src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true 3 | }; 4 | -------------------------------------------------------------------------------- /Chapter15/chapter_15_deploying_angular_part2/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Angular-and-Bootstrap-Third-Edition/6d52dea530bc0835c7ec648c746aa5826cab48a9/Chapter15/chapter_15_deploying_angular_part2/src/favicon.ico -------------------------------------------------------------------------------- /Chapter15/chapter_15_deploying_angular_part2/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | ShoppingCart 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /Chapter15/chapter_15_deploying_angular_part2/src/main.ts: -------------------------------------------------------------------------------- 1 | import { enableProdMode } from '@angular/core'; 2 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 3 | 4 | import { AppModule } from './app/app.module'; 5 | import { environment } from './environments/environment'; 6 | 7 | if (environment.production) { 8 | enableProdMode(); 9 | } 10 | 11 | platformBrowserDynamic().bootstrapModule(AppModule) 12 | .catch(err => console.error(err)); 13 | -------------------------------------------------------------------------------- /Chapter15/chapter_15_deploying_angular_part2/src/styles.scss: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | -------------------------------------------------------------------------------- /Chapter15/chapter_15_deploying_angular_part2/src/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/app", 5 | "types": [] 6 | }, 7 | "exclude": [ 8 | "test.ts", 9 | "**/*.spec.ts" 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /Chapter15/chapter_15_deploying_angular_part2/src/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/spec", 5 | "types": [ 6 | "jasmine", 7 | "node" 8 | ] 9 | }, 10 | "files": [ 11 | "test.ts", 12 | "polyfills.ts" 13 | ], 14 | "include": [ 15 | "**/*.spec.ts", 16 | "**/*.d.ts" 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /Chapter15/chapter_15_deploying_angular_part2/src/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tslint.json", 3 | "rules": { 4 | "directive-selector": [ 5 | true, 6 | "attribute", 7 | "app", 8 | "camelCase" 9 | ], 10 | "component-selector": [ 11 | true, 12 | "element", 13 | "app", 14 | "kebab-case" 15 | ] 16 | } 17 | } 18 | --------------------------------------------------------------------------------