├── Food-order ├── .gitignore ├── firstapp ├── src │ ├── assets │ │ └── .gitkeep │ ├── app │ │ ├── nav │ │ │ ├── nav.component.css │ │ │ ├── nav.component.ts │ │ │ ├── nav.component.html │ │ │ └── nav.component.spec.ts │ │ ├── about │ │ │ ├── about.component.css │ │ │ ├── about.component.html │ │ │ ├── about.component.ts │ │ │ └── about.component.spec.ts │ │ ├── home │ │ │ ├── home.component.css │ │ │ ├── home.component.html │ │ │ ├── home.component.ts │ │ │ └── home.component.spec.ts │ │ ├── admin │ │ │ ├── list │ │ │ │ ├── list.component.css │ │ │ │ ├── list.component.html │ │ │ │ ├── list.component.ts │ │ │ │ └── list.component.spec.ts │ │ │ ├── login │ │ │ │ ├── login.component.css │ │ │ │ ├── login.component.html │ │ │ │ ├── login.component.ts │ │ │ │ └── login.component.spec.ts │ │ │ ├── admin.module.ts │ │ │ └── admin-routing.module.ts │ │ ├── contact │ │ │ ├── contact.component.css │ │ │ ├── contact.component.html │ │ │ ├── contact.component.ts │ │ │ └── contact.component.spec.ts │ │ ├── counter │ │ │ ├── counter.component.css │ │ │ ├── counter.component.html │ │ │ ├── counter.component.ts │ │ │ └── counter.component.spec.ts │ │ ├── view-child │ │ │ ├── view-child.component.css │ │ │ ├── view-child.component.spec.ts │ │ │ ├── view-child.component.html │ │ │ └── view-child.component.ts │ │ ├── user │ │ │ ├── saving-acc │ │ │ │ ├── saving-acc.component.css │ │ │ │ ├── saving-acc.component.html │ │ │ │ ├── saving-acc.component.ts │ │ │ │ └── saving-acc.component.spec.ts │ │ │ ├── current-acc │ │ │ │ ├── current-acc.component.css │ │ │ │ ├── current-acc.component.html │ │ │ │ ├── current-acc.component.ts │ │ │ │ └── current-acc.component.spec.ts │ │ │ └── user.module.ts │ │ ├── child-lifecycle-hooks │ │ │ ├── child-lifecycle-hooks.component.css │ │ │ ├── child-lifecycle-hooks.component.html │ │ │ ├── child-lifecycle-hooks.component.ts │ │ │ └── child-lifecycle-hooks.component.spec.ts │ │ ├── parent-lifecycle-hooks │ │ │ ├── parent-lifecycle-hooks.component.css │ │ │ ├── parent-lifecycle-hooks.component.html │ │ │ ├── parent-lifecycle-hooks.component.ts │ │ │ └── parent-lifecycle-hooks.component.spec.ts │ │ ├── app.component.css │ │ ├── beverages │ │ │ ├── beverages.component.css │ │ │ ├── beverages.component.html │ │ │ ├── beverages.component.ts │ │ │ └── beverages.component.spec.ts │ │ ├── demo-directive.directive.spec.ts │ │ ├── auth.guard.spec.ts │ │ ├── auth.guard.ts │ │ ├── demo-directive.directive.ts │ │ ├── user-routing.module.ts │ │ ├── app-routing.module.ts │ │ ├── app.component.spec.ts │ │ └── app.module.ts │ ├── favicon.ico │ ├── styles.css │ ├── main.ts │ └── index.html ├── .vscode │ ├── extensions.json │ ├── launch.json │ └── tasks.json ├── tsconfig.app.json ├── tsconfig.spec.json ├── .editorconfig ├── .gitignore ├── tsconfig.json ├── README.md └── package.json ├── todoList ├── src │ ├── assets │ │ └── .gitkeep │ ├── app │ │ ├── app.component.css │ │ ├── todo-list │ │ │ ├── task.ts │ │ │ ├── todo-list.component.spec.ts │ │ │ ├── todo-list.component.css │ │ │ └── todo-list.component.ts │ │ ├── app.component.html │ │ ├── app.component.ts │ │ ├── app-routing.module.ts │ │ ├── app.component.spec.ts │ │ └── app.module.ts │ ├── favicon.ico │ ├── styles.css │ ├── main.ts │ └── index.html ├── .vscode │ ├── extensions.json │ ├── launch.json │ └── tasks.json ├── tsconfig.app.json ├── tsconfig.spec.json ├── .editorconfig ├── .gitignore ├── tsconfig.json ├── README.md └── package.json ├── Crud-using-Services ├── src │ ├── assets │ │ └── .gitkeep │ ├── favicon.ico │ ├── styles.css │ ├── main.ts │ ├── app │ │ ├── app.component.css │ │ ├── app-routing.module.ts │ │ ├── api.service.spec.ts │ │ ├── dialog │ │ │ ├── dialog.component.css │ │ │ └── dialog.component.spec.ts │ │ ├── api.service.ts │ │ ├── app.component.spec.ts │ │ └── app.module.ts │ └── index.html ├── .vscode │ ├── extensions.json │ ├── launch.json │ └── tasks.json ├── tsconfig.app.json ├── tsconfig.spec.json ├── .editorconfig ├── .gitignore ├── tsconfig.json ├── db.json ├── README.md └── package.json ├── fb-login-page-routing ├── src │ ├── assets │ │ └── .gitkeep │ ├── app │ │ ├── app.component.css │ │ ├── signup │ │ │ ├── signup.component.css │ │ │ ├── signup.component.ts │ │ │ ├── signup.component.spec.ts │ │ │ └── signup.component.html │ │ ├── forgot-password │ │ │ ├── forgot-password.component.css │ │ │ ├── forgot-password.component.ts │ │ │ ├── forgot-password.component.spec.ts │ │ │ └── forgot-password.component.html │ │ ├── app.component.html │ │ ├── profile │ │ │ ├── profile.component.ts │ │ │ ├── profile.component.spec.ts │ │ │ ├── profile.component.css │ │ │ └── profile.component.html │ │ ├── app.component.ts │ │ ├── login │ │ │ ├── login.component.ts │ │ │ ├── login.component.spec.ts │ │ │ ├── login.component.css │ │ │ └── login.component.html │ │ ├── auth.guard.spec.ts │ │ ├── auth.guard.ts │ │ ├── app.module.ts │ │ ├── app-routing.module.ts │ │ └── app.component.spec.ts │ ├── styles.css │ ├── favicon.ico │ ├── main.ts │ └── index.html ├── .vscode │ ├── extensions.json │ ├── launch.json │ └── tasks.json ├── tsconfig.app.json ├── tsconfig.spec.json ├── .editorconfig ├── README.md ├── .gitignore ├── tsconfig.json └── package.json ├── FoodOrder_App ├── Food_order │ ├── src │ │ ├── assets │ │ │ ├── .gitkeep │ │ │ ├── assets │ │ │ │ └── .gitkeep │ │ │ ├── food-1.jpg │ │ │ ├── food-2.jpg │ │ │ ├── food-3.jpg │ │ │ ├── food-4.jpg │ │ │ ├── food-5.jpg │ │ │ ├── food-6.jpg │ │ │ ├── food-10.jpeg │ │ │ ├── food-11.jpeg │ │ │ ├── food-12.jpeg │ │ │ ├── food-7.jpeg │ │ │ ├── food-8.jpeg │ │ │ └── food-9.jpeg │ │ ├── app │ │ │ ├── app.component.css │ │ │ ├── components │ │ │ │ ├── partial │ │ │ │ │ ├── validations │ │ │ │ │ │ ├── validations.component.css │ │ │ │ │ │ ├── validations.component.html │ │ │ │ │ │ ├── validations.component.spec.ts │ │ │ │ │ │ └── validations.component.ts │ │ │ │ │ ├── input-container │ │ │ │ │ │ ├── input-container.component.css │ │ │ │ │ │ ├── input-container.component.html │ │ │ │ │ │ ├── input-container.component.ts │ │ │ │ │ │ └── input-container.component.spec.ts │ │ │ │ │ ├── title │ │ │ │ │ │ ├── title.component.css │ │ │ │ │ │ ├── title.component.html │ │ │ │ │ │ ├── title.component.ts │ │ │ │ │ │ └── title.component.spec.ts │ │ │ │ │ ├── not-found │ │ │ │ │ │ ├── not-found.component.html │ │ │ │ │ │ ├── not-found.component.css │ │ │ │ │ │ ├── not-found.component.ts │ │ │ │ │ │ └── not-found.component.spec.ts │ │ │ │ │ ├── tags │ │ │ │ │ │ ├── tags.component.html │ │ │ │ │ │ ├── tags.component.css │ │ │ │ │ │ ├── tags.component.ts │ │ │ │ │ │ └── tags.component.spec.ts │ │ │ │ │ ├── search │ │ │ │ │ │ ├── search.component.html │ │ │ │ │ │ ├── search.component.ts │ │ │ │ │ │ ├── search.component.css │ │ │ │ │ │ └── search.component.spec.ts │ │ │ │ │ └── header │ │ │ │ │ │ ├── header.component.spec.ts │ │ │ │ │ │ ├── header.component.html │ │ │ │ │ │ ├── header.component.ts │ │ │ │ │ │ └── header.component.css │ │ │ │ └── pages │ │ │ │ │ ├── home │ │ │ │ │ ├── home.component.spec.ts │ │ │ │ │ ├── home.component.ts │ │ │ │ │ ├── home.component.html │ │ │ │ │ └── home.component.css │ │ │ │ │ ├── login │ │ │ │ │ ├── login.component.spec.ts │ │ │ │ │ ├── login.component.css │ │ │ │ │ ├── login.component.html │ │ │ │ │ └── login.component.ts │ │ │ │ │ ├── cart-page │ │ │ │ │ ├── cart-page.component.spec.ts │ │ │ │ │ ├── cart-page.component.ts │ │ │ │ │ ├── cart-page.component.html │ │ │ │ │ └── cart-page.component.css │ │ │ │ │ └── food-page │ │ │ │ │ ├── food-page.component.spec.ts │ │ │ │ │ ├── food-page.component.ts │ │ │ │ │ ├── food-page.component.html │ │ │ │ │ └── food-page.component.css │ │ │ ├── app.component.html │ │ │ ├── app.component.ts │ │ │ ├── constants │ │ │ │ └── urls.ts │ │ │ ├── services │ │ │ │ ├── cart.service.spec.ts │ │ │ │ ├── food.service.spec.ts │ │ │ │ ├── user.service.spec.ts │ │ │ │ ├── food.service.ts │ │ │ │ ├── user.service.ts │ │ │ │ └── cart.service.ts │ │ │ ├── app-routing.module.ts │ │ │ ├── app.component.spec.ts │ │ │ └── app.module.ts │ │ ├── Tag.ts │ │ ├── environments │ │ │ ├── environment.prod.ts │ │ │ └── environment.ts │ │ ├── favicon.ico │ │ ├── interfaces │ │ │ └── IUserLogin.ts │ │ ├── styles.css │ │ ├── main.ts │ │ ├── test.ts │ │ └── index.html │ ├── Cart.ts │ ├── user.ts │ ├── CartItems.ts │ ├── Food.ts │ ├── .editorconfig │ ├── tsconfig.app.json │ ├── tsconfig.spec.json │ ├── .browserslistrc │ ├── .gitignore │ ├── tsconfig.json │ ├── README.md │ ├── package.json │ └── karma.conf.js └── backend │ ├── .gitignore │ ├── src │ ├── .env │ ├── configs │ │ └── database.config.ts │ ├── models │ │ ├── user.model.ts │ │ └── food.model.ts │ ├── router │ │ ├── user.router.ts │ │ └── food.router.ts │ └── server.ts │ ├── tsconfig.json │ └── package.json ├── 03 notes ├── directives diagram.png ├── ngStyle.txt ├── ngClass.txt └── ng-switch.txt ├── 02 TypeScript ├── demo.ts ├── demo.js └── index.html ├── 01 JavaScript ├── hello.html ├── oops.html ├── rest_operator.html ├── ifelse.html ├── switchCase.html ├── ArrayCRUD.html ├── object.html ├── hoisting.html ├── function.html ├── mathMethod.html ├── loops.html └── numberMethod.html ├── .vscode └── launch.json └── readme.md /Food-order: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules -------------------------------------------------------------------------------- /firstapp/src/assets/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /todoList/src/assets/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /firstapp/src/app/nav/nav.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /todoList/src/app/app.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Crud-using-Services/src/assets/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /fb-login-page-routing/src/assets/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /firstapp/src/app/about/about.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /firstapp/src/app/home/home.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /FoodOrder_App/Food_order/src/assets/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /FoodOrder_App/backend/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules -------------------------------------------------------------------------------- /fb-login-page-routing/src/app/app.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /firstapp/src/app/admin/list/list.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /firstapp/src/app/admin/login/login.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /firstapp/src/app/contact/contact.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /firstapp/src/app/counter/counter.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /FoodOrder_App/Food_order/src/app/app.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /FoodOrder_App/Food_order/src/assets/assets/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /firstapp/src/app/view-child/view-child.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /fb-login-page-routing/src/app/signup/signup.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /firstapp/src/app/user/saving-acc/saving-acc.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /firstapp/src/app/user/current-acc/current-acc.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /firstapp/src/app/counter/counter.component.html: -------------------------------------------------------------------------------- 1 |

{{message}}

-------------------------------------------------------------------------------- /firstapp/src/app/admin/list/list.component.html: -------------------------------------------------------------------------------- 1 |

list works!

2 | -------------------------------------------------------------------------------- /firstapp/src/app/admin/login/login.component.html: -------------------------------------------------------------------------------- 1 |

login works!

2 | -------------------------------------------------------------------------------- /fb-login-page-routing/src/app/forgot-password/forgot-password.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /firstapp/src/app/child-lifecycle-hooks/child-lifecycle-hooks.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /firstapp/src/app/parent-lifecycle-hooks/parent-lifecycle-hooks.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /FoodOrder_App/Food_order/src/app/components/partial/validations/validations.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /firstapp/src/app/user/current-acc/current-acc.component.html: -------------------------------------------------------------------------------- 1 |

current-acc works!

2 | -------------------------------------------------------------------------------- /FoodOrder_App/Food_order/src/app/components/partial/input-container/input-container.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /firstapp/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjundhav/Angular/master/firstapp/src/favicon.ico -------------------------------------------------------------------------------- /todoList/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjundhav/Angular/master/todoList/src/favicon.ico -------------------------------------------------------------------------------- /FoodOrder_App/Food_order/src/Tag.ts: -------------------------------------------------------------------------------- 1 | export class Tag{ 2 | name!:string 3 | count!:number 4 | } 5 | 6 | -------------------------------------------------------------------------------- /firstapp/src/styles.css: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | -------------------------------------------------------------------------------- /03 notes/directives diagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjundhav/Angular/master/03 notes/directives diagram.png -------------------------------------------------------------------------------- /FoodOrder_App/Food_order/src/app/components/partial/title/title.component.css: -------------------------------------------------------------------------------- 1 | h1{ 2 | color: red; 3 | 4 | } 5 | -------------------------------------------------------------------------------- /FoodOrder_App/backend/src/.env: -------------------------------------------------------------------------------- 1 | MONGO_URI=mongodb+srv://mayuri:0PFyunXX03rHs0g5@cluster0.ffbgcmg.mongodb.net/cluster0 -------------------------------------------------------------------------------- /todoList/src/app/todo-list/task.ts: -------------------------------------------------------------------------------- 1 | export class ITask { 2 | 3 | description!:string[] 4 | done!:boolean 5 | } -------------------------------------------------------------------------------- /fb-login-page-routing/src/styles.css: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | -------------------------------------------------------------------------------- /todoList/src/app/app.component.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /Crud-using-Services/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjundhav/Angular/master/Crud-using-Services/src/favicon.ico -------------------------------------------------------------------------------- /FoodOrder_App/Food_order/src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true 3 | }; 4 | -------------------------------------------------------------------------------- /fb-login-page-routing/src/app/app.component.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /fb-login-page-routing/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjundhav/Angular/master/fb-login-page-routing/src/favicon.ico -------------------------------------------------------------------------------- /FoodOrder_App/Food_order/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjundhav/Angular/master/FoodOrder_App/Food_order/src/favicon.ico -------------------------------------------------------------------------------- /FoodOrder_App/Food_order/src/interfaces/IUserLogin.ts: -------------------------------------------------------------------------------- 1 | export interface IUserLogin{ 2 | email:string; 3 | password:string; 4 | } -------------------------------------------------------------------------------- /firstapp/src/app/user/saving-acc/saving-acc.component.html: -------------------------------------------------------------------------------- 1 |
2 |

Saving Account Component

3 |
4 | 5 | -------------------------------------------------------------------------------- /FoodOrder_App/Food_order/src/assets/food-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjundhav/Angular/master/FoodOrder_App/Food_order/src/assets/food-1.jpg -------------------------------------------------------------------------------- /FoodOrder_App/Food_order/src/assets/food-2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjundhav/Angular/master/FoodOrder_App/Food_order/src/assets/food-2.jpg -------------------------------------------------------------------------------- /FoodOrder_App/Food_order/src/assets/food-3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjundhav/Angular/master/FoodOrder_App/Food_order/src/assets/food-3.jpg -------------------------------------------------------------------------------- /FoodOrder_App/Food_order/src/assets/food-4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjundhav/Angular/master/FoodOrder_App/Food_order/src/assets/food-4.jpg -------------------------------------------------------------------------------- /FoodOrder_App/Food_order/src/assets/food-5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjundhav/Angular/master/FoodOrder_App/Food_order/src/assets/food-5.jpg -------------------------------------------------------------------------------- /FoodOrder_App/Food_order/src/assets/food-6.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjundhav/Angular/master/FoodOrder_App/Food_order/src/assets/food-6.jpg -------------------------------------------------------------------------------- /FoodOrder_App/Food_order/src/assets/food-10.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjundhav/Angular/master/FoodOrder_App/Food_order/src/assets/food-10.jpeg -------------------------------------------------------------------------------- /FoodOrder_App/Food_order/src/assets/food-11.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjundhav/Angular/master/FoodOrder_App/Food_order/src/assets/food-11.jpeg -------------------------------------------------------------------------------- /FoodOrder_App/Food_order/src/assets/food-12.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjundhav/Angular/master/FoodOrder_App/Food_order/src/assets/food-12.jpeg -------------------------------------------------------------------------------- /FoodOrder_App/Food_order/src/assets/food-7.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjundhav/Angular/master/FoodOrder_App/Food_order/src/assets/food-7.jpeg -------------------------------------------------------------------------------- /FoodOrder_App/Food_order/src/assets/food-8.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjundhav/Angular/master/FoodOrder_App/Food_order/src/assets/food-8.jpeg -------------------------------------------------------------------------------- /FoodOrder_App/Food_order/src/assets/food-9.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjundhav/Angular/master/FoodOrder_App/Food_order/src/assets/food-9.jpeg -------------------------------------------------------------------------------- /02 TypeScript/demo.ts: -------------------------------------------------------------------------------- 1 | export class Demo { 2 | name:"test" 3 | age:10 4 | details(){ 5 | document.write(`${this.name}); 6 | } 7 | 8 | } -------------------------------------------------------------------------------- /FoodOrder_App/Food_order/src/app/app.component.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /FoodOrder_App/Food_order/src/app/components/partial/title/title.component.html: -------------------------------------------------------------------------------- 1 |

2 | {{title}} 3 |

4 | -------------------------------------------------------------------------------- /firstapp/src/app/home/home.component.html: -------------------------------------------------------------------------------- 1 |
2 |

Welcome To Our HomePage


3 |

Our homepage is Working

4 |
5 | -------------------------------------------------------------------------------- /firstapp/.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=827846 3 | "recommendations": ["angular.ng-template"] 4 | } 5 | -------------------------------------------------------------------------------- /todoList/.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=827846 3 | "recommendations": ["angular.ng-template"] 4 | } 5 | -------------------------------------------------------------------------------- /firstapp/src/app/app.component.css: -------------------------------------------------------------------------------- 1 | .parent{ 2 | background-color: #f5f5f5; 3 | padding: 10px; 4 | margin: 10px; 5 | border: 1px solid #ccc; 6 | border-radius: 5px; 7 | } -------------------------------------------------------------------------------- /Crud-using-Services/.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=827846 3 | "recommendations": ["angular.ng-template"] 4 | } 5 | -------------------------------------------------------------------------------- /fb-login-page-routing/.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=827846 3 | "recommendations": ["angular.ng-template"] 4 | } 5 | -------------------------------------------------------------------------------- /firstapp/src/app/about/about.component.html: -------------------------------------------------------------------------------- 1 |
2 |

About Me


3 |

My name is {{ name }}

4 |

My project name is {{ title }}

5 |
-------------------------------------------------------------------------------- /FoodOrder_App/Food_order/Cart.ts: -------------------------------------------------------------------------------- 1 | import { CartItem } from "CartItems"; 2 | 3 | export class Cart 4 | { 5 | items:CartItem[]=[]; 6 | totalPrice:number=0; 7 | totalCount:number=0; 8 | } 9 | -------------------------------------------------------------------------------- /FoodOrder_App/Food_order/user.ts: -------------------------------------------------------------------------------- 1 | export class User{ 2 | id!:string; 3 | email!:string; 4 | name!:string; 5 | address!:string; 6 | token!:string; 7 | isAdmin!:boolean; 8 | } -------------------------------------------------------------------------------- /firstapp/src/app/beverages/beverages.component.css: -------------------------------------------------------------------------------- 1 | .child{ 2 | background-color: #f5f5f5; 3 | padding: 10px; 4 | margin: 10px; 5 | border: 1px solid #ccc; 6 | border-radius: 5px; 7 | } -------------------------------------------------------------------------------- /FoodOrder_App/Food_order/src/app/components/partial/not-found/not-found.component.html: -------------------------------------------------------------------------------- 1 |
2 | {{notFoundMessage}} 3 | {{resetLinkText}}
5 | -------------------------------------------------------------------------------- /todoList/src/styles.css: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | 3 | html, body { height: 100%; } 4 | body { margin: 0; font-family: Roboto, "Helvetica Neue", sans-serif; } 5 | -------------------------------------------------------------------------------- /FoodOrder_App/Food_order/CartItems.ts: -------------------------------------------------------------------------------- 1 | import { Food } from "Food"; 2 | 3 | 4 | export class CartItem 5 | { 6 | constructor(public food:Food){} 7 | quantity:number=1; 8 | price:number=this.food.price 9 | } 10 | -------------------------------------------------------------------------------- /FoodOrder_App/Food_order/src/app/components/partial/tags/tags.component.html: -------------------------------------------------------------------------------- 1 |
2 | 3 | {{tag.name}}({{tag.count}}) 4 | 5 | 6 |
7 | -------------------------------------------------------------------------------- /Crud-using-Services/src/styles.css: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | 3 | html, body { height: 100%; } 4 | body { margin: 0; font-family: Roboto, "Helvetica Neue", sans-serif; } 5 | -------------------------------------------------------------------------------- /firstapp/src/app/contact/contact.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |

Contact Details


4 |

Contact No: {{mobile}}

5 |

Email: {{email}}

6 |

Address: {{address}}

7 |
8 | -------------------------------------------------------------------------------- /firstapp/src/main.ts: -------------------------------------------------------------------------------- 1 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 2 | 3 | import { AppModule } from './app/app.module'; 4 | 5 | 6 | platformBrowserDynamic().bootstrapModule(AppModule) 7 | .catch(err => console.error(err)); 8 | -------------------------------------------------------------------------------- /todoList/src/main.ts: -------------------------------------------------------------------------------- 1 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 2 | 3 | import { AppModule } from './app/app.module'; 4 | 5 | 6 | platformBrowserDynamic().bootstrapModule(AppModule) 7 | .catch(err => console.error(err)); 8 | -------------------------------------------------------------------------------- /FoodOrder_App/Food_order/src/app/components/partial/validations/validations.component.html: -------------------------------------------------------------------------------- 1 |
2 |
{{errorMessages}}
3 | 4 | 5 |
6 | -------------------------------------------------------------------------------- /Crud-using-Services/src/main.ts: -------------------------------------------------------------------------------- 1 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 2 | 3 | import { AppModule } from './app/app.module'; 4 | 5 | 6 | platformBrowserDynamic().bootstrapModule(AppModule) 7 | .catch(err => console.error(err)); 8 | -------------------------------------------------------------------------------- /fb-login-page-routing/src/main.ts: -------------------------------------------------------------------------------- 1 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 2 | 3 | import { AppModule } from './app/app.module'; 4 | 5 | 6 | platformBrowserDynamic().bootstrapModule(AppModule) 7 | .catch(err => console.error(err)); 8 | -------------------------------------------------------------------------------- /firstapp/src/app/nav/nav.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-nav', 5 | templateUrl: './nav.component.html', 6 | styleUrls: ['./nav.component.css'] 7 | }) 8 | export class NavComponent { 9 | 10 | } 11 | -------------------------------------------------------------------------------- /FoodOrder_App/Food_order/src/app/components/partial/search/search.component.html: -------------------------------------------------------------------------------- 1 |
2 | 5 | 6 |
7 | -------------------------------------------------------------------------------- /firstapp/src/app/child-lifecycle-hooks/child-lifecycle-hooks.component.html: -------------------------------------------------------------------------------- 1 |

Child Lifecycle Hooks

2 |
3 |

Input Decorator submited value: {{myvalue}}

4 | 5 |
6 | 7 | -------------------------------------------------------------------------------- /FoodOrder_App/Food_order/Food.ts: -------------------------------------------------------------------------------- 1 | export class Food 2 | { 3 | id!:string ; 4 | name!:string; 5 | price!:number; 6 | tags?:string[]; 7 | favorite!:boolean; 8 | stars!:number; 9 | imageUrl!:string; 10 | origins!:string[]; 11 | cookTime!:string; 12 | 13 | } 14 | -------------------------------------------------------------------------------- /firstapp/src/app/home/home.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-home', 5 | templateUrl: './home.component.html', 6 | styleUrls: ['./home.component.css'] 7 | }) 8 | export class HomeComponent { 9 | 10 | } 11 | -------------------------------------------------------------------------------- /firstapp/src/app/admin/list/list.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-list', 5 | templateUrl: './list.component.html', 6 | styleUrls: ['./list.component.css'] 7 | }) 8 | export class ListComponent { 9 | 10 | } 11 | -------------------------------------------------------------------------------- /firstapp/src/app/admin/login/login.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-login', 5 | templateUrl: './login.component.html', 6 | styleUrls: ['./login.component.css'] 7 | }) 8 | export class LoginComponent { 9 | 10 | } 11 | -------------------------------------------------------------------------------- /Crud-using-Services/src/app/app.component.css: -------------------------------------------------------------------------------- 1 | .example-spacer { 2 | flex: 1 1 auto; 3 | } 4 | 5 | table { 6 | width: 100%; 7 | } 8 | 9 | .mat-mdc-form-field { 10 | font-size: 14px; 11 | width: 100%; 12 | } 13 | 14 | td, th { 15 | width: 25%; 16 | } 17 | -------------------------------------------------------------------------------- /fb-login-page-routing/src/app/signup/signup.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-signup', 5 | templateUrl: './signup.component.html', 6 | styleUrls: ['./signup.component.css'] 7 | }) 8 | export class SignupComponent { 9 | 10 | } 11 | -------------------------------------------------------------------------------- /FoodOrder_App/Food_order/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 = 'Food_order'; 10 | } 11 | -------------------------------------------------------------------------------- /fb-login-page-routing/src/app/profile/profile.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-profile', 5 | templateUrl: './profile.component.html', 6 | styleUrls: ['./profile.component.css'] 7 | }) 8 | export class ProfileComponent { 9 | 10 | } 11 | -------------------------------------------------------------------------------- /fb-login-page-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.css'] 7 | }) 8 | export class AppComponent { 9 | title = 'fb-login-page-routing'; 10 | } 11 | -------------------------------------------------------------------------------- /todoList/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 = 'boot-ng-material'; 10 | picker: any; 11 | } 12 | -------------------------------------------------------------------------------- /firstapp/src/app/user/saving-acc/saving-acc.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-saving-acc', 5 | templateUrl: './saving-acc.component.html', 6 | styleUrls: ['./saving-acc.component.css'] 7 | }) 8 | export class SavingAccComponent { 9 | 10 | } 11 | -------------------------------------------------------------------------------- /FoodOrder_App/Food_order/src/app/components/partial/input-container/input-container.component.html: -------------------------------------------------------------------------------- 1 |
2 | 5 | 6 |
7 | 8 |
9 |
10 | -------------------------------------------------------------------------------- /FoodOrder_App/Food_order/src/app/components/partial/tags/tags.component.css: -------------------------------------------------------------------------------- 1 | div{ 2 | display: flex; 3 | flex-wrap: wrap; 4 | } 5 | div a{ 6 | background-color: lightblue; 7 | padding: 1rem; 8 | margin: 0.5rem 0.3rem 0.8rem 5rem; 9 | border-radius: 1rem; 10 | font-weight: 400; 11 | color: blue; 12 | } 13 | -------------------------------------------------------------------------------- /FoodOrder_App/Food_order/src/styles.css: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | @import '~ngx-toastr/toastr'; 3 | 4 | *{ 5 | box-sizing: border-box; 6 | } 7 | html{ 8 | font-size: 16px; 9 | } 10 | body{ 11 | margin: 0; 12 | } 13 | a{ 14 | text-decoration: none; 15 | } 16 | -------------------------------------------------------------------------------- /firstapp/src/app/about/about.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-about', 5 | templateUrl: './about.component.html', 6 | styleUrls: ['./about.component.css'] 7 | }) 8 | export class AboutComponent { 9 | title = 'About'; 10 | name ='Kunal'; 11 | } 12 | -------------------------------------------------------------------------------- /firstapp/src/app/demo-directive.directive.spec.ts: -------------------------------------------------------------------------------- 1 | import { DemoDirectiveDirective } from './demo-directive.directive'; 2 | 3 | describe('DemoDirectiveDirective', () => { 4 | it('should create an instance', () => { 5 | const directive = new DemoDirectiveDirective(); 6 | expect(directive).toBeTruthy(); 7 | }); 8 | }); 9 | -------------------------------------------------------------------------------- /firstapp/src/app/user/current-acc/current-acc.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-current-acc', 5 | templateUrl: './current-acc.component.html', 6 | styleUrls: ['./current-acc.component.css'] 7 | }) 8 | 9 | export class CurrentAccComponent { 10 | 11 | } 12 | -------------------------------------------------------------------------------- /todoList/src/app/app-routing.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { RouterModule, Routes } 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 | -------------------------------------------------------------------------------- /Crud-using-Services/src/app/app-routing.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { RouterModule, Routes } 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 | -------------------------------------------------------------------------------- /fb-login-page-routing/src/app/forgot-password/forgot-password.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-forgot-password', 5 | templateUrl: './forgot-password.component.html', 6 | styleUrls: ['./forgot-password.component.css'] 7 | }) 8 | export class ForgotPasswordComponent { 9 | 10 | } 11 | -------------------------------------------------------------------------------- /firstapp/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "extends": "./tsconfig.json", 4 | "compilerOptions": { 5 | "outDir": "./out-tsc/app", 6 | "types": [] 7 | }, 8 | "files": [ 9 | "src/main.ts" 10 | ], 11 | "include": [ 12 | "src/**/*.d.ts" 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /todoList/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "extends": "./tsconfig.json", 4 | "compilerOptions": { 5 | "outDir": "./out-tsc/app", 6 | "types": [] 7 | }, 8 | "files": [ 9 | "src/main.ts" 10 | ], 11 | "include": [ 12 | "src/**/*.d.ts" 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /FoodOrder_App/backend/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "CommonJs", 4 | "moduleResolution": "node", 5 | "strict": true, 6 | "outDir": "./built", 7 | "experimentalDecorators": true, 8 | "emitDecoratorMetadata": true, 9 | "esModuleInterop": true }, 10 | 11 | "include":["src/**/*"] 12 | } -------------------------------------------------------------------------------- /02 TypeScript/demo.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | exports.__esModule = true; 3 | exports.Demo = void 0; 4 | var Demo = /** @class */ (function () { 5 | function Demo() { 6 | } 7 | Demo.prototype.details = function () { 8 | document.write("".concat(this.name, ");\n }\n\n}")); 9 | }; 10 | return Demo; 11 | }()); 12 | exports.Demo = Demo; 13 | -------------------------------------------------------------------------------- /Crud-using-Services/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "extends": "./tsconfig.json", 4 | "compilerOptions": { 5 | "outDir": "./out-tsc/app", 6 | "types": [] 7 | }, 8 | "files": [ 9 | "src/main.ts" 10 | ], 11 | "include": [ 12 | "src/**/*.d.ts" 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /fb-login-page-routing/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "extends": "./tsconfig.json", 4 | "compilerOptions": { 5 | "outDir": "./out-tsc/app", 6 | "types": [] 7 | }, 8 | "files": [ 9 | "src/main.ts" 10 | ], 11 | "include": [ 12 | "src/**/*.d.ts" 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /firstapp/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "extends": "./tsconfig.json", 4 | "compilerOptions": { 5 | "outDir": "./out-tsc/spec", 6 | "types": [ 7 | "jasmine" 8 | ] 9 | }, 10 | "include": [ 11 | "src/**/*.spec.ts", 12 | "src/**/*.d.ts" 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /todoList/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "extends": "./tsconfig.json", 4 | "compilerOptions": { 5 | "outDir": "./out-tsc/spec", 6 | "types": [ 7 | "jasmine" 8 | ] 9 | }, 10 | "include": [ 11 | "src/**/*.spec.ts", 12 | "src/**/*.d.ts" 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /firstapp/.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 | [*.ts] 12 | quote_type = single 13 | 14 | [*.md] 15 | max_line_length = off 16 | trim_trailing_whitespace = false 17 | -------------------------------------------------------------------------------- /todoList/.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 | [*.ts] 12 | quote_type = single 13 | 14 | [*.md] 15 | max_line_length = off 16 | trim_trailing_whitespace = false 17 | -------------------------------------------------------------------------------- /Crud-using-Services/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "extends": "./tsconfig.json", 4 | "compilerOptions": { 5 | "outDir": "./out-tsc/spec", 6 | "types": [ 7 | "jasmine" 8 | ] 9 | }, 10 | "include": [ 11 | "src/**/*.spec.ts", 12 | "src/**/*.d.ts" 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /Crud-using-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 | [*.ts] 12 | quote_type = single 13 | 14 | [*.md] 15 | max_line_length = off 16 | trim_trailing_whitespace = false 17 | -------------------------------------------------------------------------------- /fb-login-page-routing/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "extends": "./tsconfig.json", 4 | "compilerOptions": { 5 | "outDir": "./out-tsc/spec", 6 | "types": [ 7 | "jasmine" 8 | ] 9 | }, 10 | "include": [ 11 | "src/**/*.spec.ts", 12 | "src/**/*.d.ts" 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /firstapp/src/app/contact/contact.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-contact', 5 | templateUrl: './contact.component.html', 6 | styleUrls: ['./contact.component.css'] 7 | }) 8 | export class ContactComponent { 9 | mobile = 9423139185; 10 | email = 'arjundhav@gmail.com'; 11 | address = 'Pune'; 12 | } 13 | -------------------------------------------------------------------------------- /FoodOrder_App/Food_order/.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 | [*.ts] 12 | quote_type = single 13 | 14 | [*.md] 15 | max_line_length = off 16 | trim_trailing_whitespace = false 17 | -------------------------------------------------------------------------------- /fb-login-page-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 | [*.ts] 12 | quote_type = single 13 | 14 | [*.md] 15 | max_line_length = off 16 | trim_trailing_whitespace = false 17 | -------------------------------------------------------------------------------- /FoodOrder_App/Food_order/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "extends": "./tsconfig.json", 4 | "compilerOptions": { 5 | "outDir": "./out-tsc/app", 6 | "types": [] 7 | }, 8 | "files": [ 9 | "src/main.ts", 10 | "src/polyfills.ts" 11 | ], 12 | "include": [ 13 | "src/**/*.d.ts" 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /firstapp/src/app/beverages/beverages.component.html: -------------------------------------------------------------------------------- 1 |
2 |

Child Component

3 |

Todays Beverages is: {{beverages}}

4 | 5 | 6 | 7 |
8 | -------------------------------------------------------------------------------- /FoodOrder_App/Food_order/src/app/constants/urls.ts: -------------------------------------------------------------------------------- 1 | const BASE_URL = 'http://localhost:5000' 2 | 3 | export const FOODS_URL=BASE_URL+'/api/foods'; 4 | export const FOODS_TAG_URL=FOODS_URL+'/tags'; 5 | export const FOODS_BY_SEARCH_URL=FOODS_URL+'/search/'; 6 | export const FOODS_BY_TAG_URL=FOODS_URL+'/tag/'; 7 | export const FOODS_BY_ID_URL=FOODS_URL+'/'; 8 | 9 | export const USER_LOGIN_URL=BASE_URL+'/api/users/login' -------------------------------------------------------------------------------- /FoodOrder_App/backend/src/configs/database.config.ts: -------------------------------------------------------------------------------- 1 | import {connect, ConnectOptions} from 'mongoose' 2 | 3 | export const dbConnect=()=>{ 4 | connect(process.env.MONGO_URI!,{ 5 | useNewUrlParser:true, 6 | useUnifiedTopology:true 7 | }as ConnectOptions).then( 8 | ()=> 9 | console.log("DB connect sucessfully"), 10 | (error)=>console.log(error) 11 | ) 12 | } -------------------------------------------------------------------------------- /firstapp/src/app/parent-lifecycle-hooks/parent-lifecycle-hooks.component.html: -------------------------------------------------------------------------------- 1 |

Parent Lifecycle

2 | 3 | 4 |

5 | {{value}} 6 | 7 | -------------------------------------------------------------------------------- /02 TypeScript/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 14 | 15 | -------------------------------------------------------------------------------- /FoodOrder_App/Food_order/src/app/services/cart.service.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed } from '@angular/core/testing'; 2 | 3 | import { CartService } from './cart.service'; 4 | 5 | describe('CartService', () => { 6 | let service: CartService; 7 | 8 | beforeEach(() => { 9 | TestBed.configureTestingModule({}); 10 | service = TestBed.inject(CartService); 11 | }); 12 | 13 | it('should be created', () => { 14 | expect(service).toBeTruthy(); 15 | }); 16 | }); 17 | -------------------------------------------------------------------------------- /FoodOrder_App/Food_order/src/app/services/food.service.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed } from '@angular/core/testing'; 2 | 3 | import { FoodService } from './food.service'; 4 | 5 | describe('FoodService', () => { 6 | let service: FoodService; 7 | 8 | beforeEach(() => { 9 | TestBed.configureTestingModule({}); 10 | service = TestBed.inject(FoodService); 11 | }); 12 | 13 | it('should be created', () => { 14 | expect(service).toBeTruthy(); 15 | }); 16 | }); 17 | -------------------------------------------------------------------------------- /FoodOrder_App/Food_order/src/app/services/user.service.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed } from '@angular/core/testing'; 2 | 3 | import { UserService } from './user.service'; 4 | 5 | describe('UserService', () => { 6 | let service: UserService; 7 | 8 | beforeEach(() => { 9 | TestBed.configureTestingModule({}); 10 | service = TestBed.inject(UserService); 11 | }); 12 | 13 | it('should be created', () => { 14 | expect(service).toBeTruthy(); 15 | }); 16 | }); 17 | -------------------------------------------------------------------------------- /fb-login-page-routing/README.md: -------------------------------------------------------------------------------- 1 | `ng new appName` 2 | `ng g c cName` 3 | `ng g m User` 4 | 5 | 6 | ## Development server 7 | 8 | Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The application will automatically reload if you change any of the source files. 9 | 10 | ## Code scaffolding 11 | 12 | Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`. 13 | -------------------------------------------------------------------------------- /firstapp/src/app/nav/nav.component.html: -------------------------------------------------------------------------------- 1 | 19 | 20 | 25 | -------------------------------------------------------------------------------- /FoodOrder_App/Food_order/src/app/components/partial/not-found/not-found.component.css: -------------------------------------------------------------------------------- 1 | div{ 2 | display: flex; 3 | 4 | align-items: center; 5 | justify-content: center; 6 | flex-direction: column; 7 | font-size: 1.5rem; 8 | font-weight: 100; 9 | height: 15rem; 10 | } 11 | a{ 12 | font-size: 1.1rem; 13 | background-color: #e72929; 14 | color: white; 15 | border-radius: 10rem; 16 | padding: 0.7rem 1rem; 17 | margin: 1rem; 18 | opacity: 0.7; 19 | 20 | } 21 | a:hover{ 22 | opacity: 1; 23 | cursor: pointer; 24 | } 25 | -------------------------------------------------------------------------------- /FoodOrder_App/Food_order/src/app/components/partial/title/title.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, Input, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-title', 5 | templateUrl: './title.component.html', 6 | styleUrls: ['./title.component.css'] 7 | }) 8 | export class TitleComponent implements OnInit { 9 | 10 | constructor() { } 11 | @Input() 12 | title!:string; 13 | 14 | @Input() 15 | margin?='1rem 0 1rem 0.2rem'; 16 | 17 | @Input() 18 | fontSize?='1.7rem'; 19 | 20 | ngOnInit(): void { 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /firstapp/src/app/admin/admin.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { CommonModule } from '@angular/common'; 3 | 4 | import { AdminRoutingModule } from './admin-routing.module'; 5 | import { LoginComponent } from './login/login.component'; 6 | import { ListComponent } from './list/list.component'; 7 | 8 | 9 | @NgModule({ 10 | declarations: [ 11 | LoginComponent, 12 | ListComponent 13 | ], 14 | imports: [ 15 | CommonModule, 16 | AdminRoutingModule 17 | ] 18 | }) 19 | export class AdminModule { } 20 | -------------------------------------------------------------------------------- /firstapp/src/app/auth.guard.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | import { ActivatedRouteSnapshot, CanActivate, RouterStateSnapshot, UrlTree } from '@angular/router'; 3 | import { Observable } from 'rxjs'; 4 | 5 | @Injectable({ 6 | providedIn: 'root' 7 | }) 8 | export class AuthGuard implements CanActivate { 9 | canActivate( 10 | route: ActivatedRouteSnapshot, 11 | state: RouterStateSnapshot): Observable | Promise | boolean | UrlTree { 12 | return false; 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /firstapp/src/app/demo-directive.directive.ts: -------------------------------------------------------------------------------- 1 | import { Directive, ElementRef,AfterViewInit} from '@angular/core'; 2 | 3 | @Directive({ 4 | selector: '[appDemoDirective]' 5 | }) 6 | export class DemoDirectiveDirective implements AfterViewInit{ 7 | 8 | constructor(private el: ElementRef) { } 9 | 10 | ngAfterViewInit() { 11 | this.el.nativeElement.style.backgroundColor = 'yellow'; 12 | } 13 | 14 | change(changedcolor:string){ 15 | this.el.nativeElement.style.backgroundColor = changedcolor; 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "type": "chrome", 9 | "request": "launch", 10 | "name": "Launch Chrome against localhost", 11 | "url": "http://localhost:8080", 12 | "webRoot": "${workspaceFolder}" 13 | } 14 | ] 15 | } -------------------------------------------------------------------------------- /FoodOrder_App/Food_order/src/app/components/partial/input-container/input-container.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, Input, OnChanges, OnInit, SimpleChanges } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-input-container', 5 | templateUrl: './input-container.component.html', 6 | styleUrls: ['./input-container.component.css'] 7 | }) 8 | export class InputContainerComponent implements OnInit{ 9 | @Input() 10 | label!:String; 11 | @Input() 12 | bgColor='white'; 13 | constructor() { } 14 | 15 | ngOnInit(): void { 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /fb-login-page-routing/src/app/auth.guard.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | import { ActivatedRouteSnapshot, CanActivate, RouterStateSnapshot, UrlTree } from '@angular/router'; 3 | import { Observable } from 'rxjs'; 4 | 5 | @Injectable({ 6 | providedIn: 'root' 7 | }) 8 | export class AuthGuard implements CanActivate { 9 | canActivate( 10 | route: ActivatedRouteSnapshot, 11 | state: RouterStateSnapshot): Observable | Promise | boolean | UrlTree { 12 | return false; 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /Crud-using-Services/src/app/dialog/dialog.component.css: -------------------------------------------------------------------------------- 1 | form{ 2 | border: 2px; 3 | padding: 10px; 4 | } 5 | 6 | mat-form-field{ 7 | width: 100%; 8 | } 9 | 10 | .example-radio-group { 11 | display: flex; 12 | flex-direction: column; 13 | margin: 15px 0; 14 | align-items: flex-start; 15 | } 16 | 17 | .example-radio-button { 18 | margin: 5px; 19 | } 20 | 21 | .example-right-align { 22 | text-align: right; 23 | } 24 | 25 | input.example-right-align::-webkit-inner-spin-button { 26 | display: none; 27 | } 28 | -------------------------------------------------------------------------------- /firstapp/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Firstapp 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /firstapp/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 3 | "version": "0.2.0", 4 | "configurations": [ 5 | { 6 | "name": "ng serve", 7 | "type": "pwa-chrome", 8 | "request": "launch", 9 | "preLaunchTask": "npm: start", 10 | "url": "http://localhost:4200/" 11 | }, 12 | { 13 | "name": "ng test", 14 | "type": "chrome", 15 | "request": "launch", 16 | "preLaunchTask": "npm: test", 17 | "url": "http://localhost:9876/debug.html" 18 | } 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /todoList/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 3 | "version": "0.2.0", 4 | "configurations": [ 5 | { 6 | "name": "ng serve", 7 | "type": "pwa-chrome", 8 | "request": "launch", 9 | "preLaunchTask": "npm: start", 10 | "url": "http://localhost:4200/" 11 | }, 12 | { 13 | "name": "ng test", 14 | "type": "chrome", 15 | "request": "launch", 16 | "preLaunchTask": "npm: test", 17 | "url": "http://localhost:9876/debug.html" 18 | } 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /Crud-using-Services/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 3 | "version": "0.2.0", 4 | "configurations": [ 5 | { 6 | "name": "ng serve", 7 | "type": "pwa-chrome", 8 | "request": "launch", 9 | "preLaunchTask": "npm: start", 10 | "url": "http://localhost:4200/" 11 | }, 12 | { 13 | "name": "ng test", 14 | "type": "chrome", 15 | "request": "launch", 16 | "preLaunchTask": "npm: test", 17 | "url": "http://localhost:9876/debug.html" 18 | } 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /fb-login-page-routing/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 3 | "version": "0.2.0", 4 | "configurations": [ 5 | { 6 | "name": "ng serve", 7 | "type": "pwa-chrome", 8 | "request": "launch", 9 | "preLaunchTask": "npm: start", 10 | "url": "http://localhost:4200/" 11 | }, 12 | { 13 | "name": "ng test", 14 | "type": "chrome", 15 | "request": "launch", 16 | "preLaunchTask": "npm: test", 17 | "url": "http://localhost:9876/debug.html" 18 | } 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /FoodOrder_App/Food_order/src/app/components/partial/not-found/not-found.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, Input, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-not-found', 5 | templateUrl: './not-found.component.html', 6 | styleUrls: ['./not-found.component.css'] 7 | }) 8 | export class NotFoundComponent implements OnInit { 9 | @Input() 10 | visible=false; 11 | 12 | @Input() 13 | notFoundMessage="Nothing Found!" 14 | 15 | @Input() 16 | resetLinkText="Reset" 17 | 18 | @Input() 19 | resetLinkRoute="/" 20 | constructor() { } 21 | 22 | ngOnInit(): void { 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /firstapp/src/app/admin/admin-routing.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { RouterModule, Routes } from '@angular/router'; 3 | 4 | import { LoginComponent } from './login/login.component'; 5 | import { ListComponent } from './list/list.component'; 6 | 7 | console.log("Lazy Loading has Started") 8 | const routes: Routes = [ 9 | { path: 'login', component: LoginComponent }, 10 | { path: 'list', component: ListComponent } 11 | ]; 12 | 13 | @NgModule({ 14 | imports: [RouterModule.forChild(routes)], 15 | exports: [RouterModule] 16 | }) 17 | export class AdminRoutingModule { } 18 | -------------------------------------------------------------------------------- /FoodOrder_App/Food_order/src/app/components/partial/tags/tags.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import { FoodService } from 'src/app/services/food.service'; 3 | import { Tag } from 'src/Tag'; 4 | 5 | @Component({ 6 | selector: 'app-tags', 7 | templateUrl: './tags.component.html', 8 | styleUrls: ['./tags.component.css'] 9 | }) 10 | export class TagsComponent implements OnInit { 11 | tags!:Tag[] 12 | constructor(foodService:FoodService) { 13 | foodService.getAllTags().subscribe(serverTags=>{ 14 | this.tags=serverTags 15 | }) 16 | } 17 | 18 | ngOnInit(): void { 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /firstapp/src/app/counter/counter.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-counter', 5 | templateUrl: './counter.component.html', 6 | styleUrls: ['./counter.component.css'] 7 | }) 8 | export class CounterComponent implements OnInit{ 9 | count:number=0; 10 | message:string =''; 11 | 12 | constructor() { } 13 | 14 | ngOnInit(): void {} 15 | 16 | increasebyone(){ 17 | this.count= this.count+1; 18 | this.message = "Counter: "+ this.count; 19 | } 20 | 21 | decreasebyone(){ 22 | this.count= this.count-1; 23 | this.message = "Counter: "+this.count; 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /firstapp/src/app/parent-lifecycle-hooks/parent-lifecycle-hooks.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-parent-lifecycle-hooks', 5 | templateUrl: './parent-lifecycle-hooks.component.html', 6 | styleUrls: ['./parent-lifecycle-hooks.component.css'] 7 | }) 8 | export class ParentLifecycleHooksComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit():void { } 13 | 14 | value:string|undefined 15 | comp1Exist:boolean=true 16 | submitValue(val:any){ 17 | console.log(val.value) 18 | } 19 | 20 | destroybtn(){ 21 | this.comp1Exist=false; 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | [![TypeScript Vs JavaScript Vs ECMAScript - Know the difference - Cynoteck](https://cynoteck.com/wp-content/uploads/2022/03/TypeScript-Vs-JavaScript-Vs-ECMAScript-2-min-875x1024.png "JS vs TS")](https://www.google.com/url?sa=i&url=https%3A%2F%2Fcynoteck.com%2Fblog-post%2Ftypescript-vs-javascript-vs-ecmascript-know-the-difference%2F&psig=AOvVaw2dSJRaMeviErc0yEh3KuST&ust=1677564895004000&source=images&cd=vfe&ved=0CBAQjRxqFwoTCNCYiq-Gtf0CFQAAAAAdAAAAABAE) 6 | 7 | 8 | 9 | ![img](https://miro.medium.com/max/875/0*mYuuRwjUfUOAdHpo.jpg) 10 | ![image](https://github.com/arjundhav/Angular/assets/63765264/302544bd-9239-43fe-b89a-06b7c8cca216) 11 | -------------------------------------------------------------------------------- /firstapp/src/app/beverages/beverages.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-beverages', 5 | templateUrl: './beverages.component.html', 6 | styleUrls: ['./beverages.component.css'] 7 | }) 8 | export class BeveragesComponent implements OnInit { 9 | @Input() beverages="Tea" 10 | @Output() newBeveragesEvent = new EventEmitter() 11 | constructor() { 12 | //constructor is empty 13 | } 14 | 15 | ngOnInit(): void { 16 | //'ngOnInit' is empty 17 | } 18 | 19 | addnewBeverages(value:string){ 20 | this.newBeveragesEvent.emit(value); 21 | } 22 | 23 | 24 | } 25 | -------------------------------------------------------------------------------- /FoodOrder_App/Food_order/.browserslistrc: -------------------------------------------------------------------------------- 1 | # This file is used by the build system to adjust CSS and JS output to support the specified browsers below. 2 | # For additional information regarding the format and rule options, please see: 3 | # https://github.com/browserslist/browserslist#queries 4 | 5 | # For the full list of supported browsers by the Angular framework, please see: 6 | # https://angular.io/guide/browser-support 7 | 8 | # You can see what browsers were selected by your queries by running: 9 | # npx browserslist 10 | 11 | last 1 Chrome version 12 | last 1 Firefox version 13 | last 2 Edge major versions 14 | last 2 Safari major versions 15 | last 2 iOS major versions 16 | Firefox ESR 17 | -------------------------------------------------------------------------------- /firstapp/src/app/nav/nav.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { NavComponent } from './nav.component'; 4 | 5 | describe('NavComponent', () => { 6 | let component: NavComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | declarations: [ NavComponent ] 12 | }) 13 | .compileComponents(); 14 | 15 | fixture = TestBed.createComponent(NavComponent); 16 | component = fixture.componentInstance; 17 | fixture.detectChanges(); 18 | }); 19 | 20 | it('should create', () => { 21 | expect(component).toBeTruthy(); 22 | }); 23 | }); 24 | -------------------------------------------------------------------------------- /01 JavaScript/oops.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Document 8 | 9 | 10 | 24 | 25 | -------------------------------------------------------------------------------- /firstapp/src/app/user/user.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { CommonModule } from '@angular/common'; 3 | import { SavingAccComponent } from './saving-acc/saving-acc.component'; 4 | import { CurrentAccComponent } from './current-acc/current-acc.component'; 5 | 6 | 7 | 8 | @NgModule({ 9 | declarations: [ 10 | SavingAccComponent, 11 | CurrentAccComponent 12 | ], 13 | imports: [ 14 | CommonModule, 15 | ], 16 | exports: [ 17 | SavingAccComponent, 18 | CurrentAccComponent 19 | ] 20 | }) 21 | export class UserModule { 22 | constructor(){ 23 | console.log("User Module Loaded"); 24 | } 25 | } 26 | export { SavingAccComponent, CurrentAccComponent }; 27 | 28 | -------------------------------------------------------------------------------- /01 JavaScript/rest_operator.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Document 8 | 9 | 10 |

Rest Operator

11 | 12 | 21 | 22 | -------------------------------------------------------------------------------- /firstapp/src/app/home/home.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { HomeComponent } from './home.component'; 4 | 5 | describe('HomeComponent', () => { 6 | let component: HomeComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | declarations: [ HomeComponent ] 12 | }) 13 | .compileComponents(); 14 | 15 | fixture = TestBed.createComponent(HomeComponent); 16 | component = fixture.componentInstance; 17 | fixture.detectChanges(); 18 | }); 19 | 20 | it('should create', () => { 21 | expect(component).toBeTruthy(); 22 | }); 23 | }); 24 | -------------------------------------------------------------------------------- /firstapp/src/app/admin/list/list.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { ListComponent } from './list.component'; 4 | 5 | describe('ListComponent', () => { 6 | let component: ListComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | declarations: [ ListComponent ] 12 | }) 13 | .compileComponents(); 14 | 15 | fixture = TestBed.createComponent(ListComponent); 16 | component = fixture.componentInstance; 17 | fixture.detectChanges(); 18 | }); 19 | 20 | it('should create', () => { 21 | expect(component).toBeTruthy(); 22 | }); 23 | }); 24 | -------------------------------------------------------------------------------- /firstapp/src/app/about/about.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { AboutComponent } from './about.component'; 4 | 5 | describe('AboutComponent', () => { 6 | let component: AboutComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | declarations: [ AboutComponent ] 12 | }) 13 | .compileComponents(); 14 | 15 | fixture = TestBed.createComponent(AboutComponent); 16 | component = fixture.componentInstance; 17 | fixture.detectChanges(); 18 | }); 19 | 20 | it('should create', () => { 21 | expect(component).toBeTruthy(); 22 | }); 23 | }); 24 | -------------------------------------------------------------------------------- /firstapp/src/app/admin/login/login.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { LoginComponent } from './login.component'; 4 | 5 | describe('LoginComponent', () => { 6 | let component: LoginComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | declarations: [ LoginComponent ] 12 | }) 13 | .compileComponents(); 14 | 15 | fixture = TestBed.createComponent(LoginComponent); 16 | component = fixture.componentInstance; 17 | fixture.detectChanges(); 18 | }); 19 | 20 | it('should create', () => { 21 | expect(component).toBeTruthy(); 22 | }); 23 | }); 24 | -------------------------------------------------------------------------------- /fb-login-page-routing/src/app/login/login.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { LoginComponent } from './login.component'; 4 | 5 | describe('LoginComponent', () => { 6 | let component: LoginComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | declarations: [ LoginComponent ] 12 | }) 13 | .compileComponents(); 14 | 15 | fixture = TestBed.createComponent(LoginComponent); 16 | component = fixture.componentInstance; 17 | fixture.detectChanges(); 18 | }); 19 | 20 | it('should create', () => { 21 | expect(component).toBeTruthy(); 22 | }); 23 | }); 24 | -------------------------------------------------------------------------------- /firstapp/src/app/contact/contact.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { ContactComponent } from './contact.component'; 4 | 5 | describe('ContactComponent', () => { 6 | let component: ContactComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | declarations: [ ContactComponent ] 12 | }) 13 | .compileComponents(); 14 | 15 | fixture = TestBed.createComponent(ContactComponent); 16 | component = fixture.componentInstance; 17 | fixture.detectChanges(); 18 | }); 19 | 20 | it('should create', () => { 21 | expect(component).toBeTruthy(); 22 | }); 23 | }); 24 | -------------------------------------------------------------------------------- /firstapp/src/app/counter/counter.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { CounterComponent } from './counter.component'; 4 | 5 | describe('CounterComponent', () => { 6 | let component: CounterComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | declarations: [ CounterComponent ] 12 | }) 13 | .compileComponents(); 14 | 15 | fixture = TestBed.createComponent(CounterComponent); 16 | component = fixture.componentInstance; 17 | fixture.detectChanges(); 18 | }); 19 | 20 | it('should create', () => { 21 | expect(component).toBeTruthy(); 22 | }); 23 | }); 24 | -------------------------------------------------------------------------------- /Crud-using-Services/src/app/dialog/dialog.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { DialogComponent } from './dialog.component'; 4 | 5 | describe('DialogComponent', () => { 6 | let component: DialogComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | declarations: [ DialogComponent ] 12 | }) 13 | .compileComponents(); 14 | 15 | fixture = TestBed.createComponent(DialogComponent); 16 | component = fixture.componentInstance; 17 | fixture.detectChanges(); 18 | }); 19 | 20 | it('should create', () => { 21 | expect(component).toBeTruthy(); 22 | }); 23 | }); 24 | -------------------------------------------------------------------------------- /fb-login-page-routing/src/app/signup/signup.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { SignupComponent } from './signup.component'; 4 | 5 | describe('SignupComponent', () => { 6 | let component: SignupComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | declarations: [ SignupComponent ] 12 | }) 13 | .compileComponents(); 14 | 15 | fixture = TestBed.createComponent(SignupComponent); 16 | component = fixture.componentInstance; 17 | fixture.detectChanges(); 18 | }); 19 | 20 | it('should create', () => { 21 | expect(component).toBeTruthy(); 22 | }); 23 | }); 24 | -------------------------------------------------------------------------------- /firstapp/.gitignore: -------------------------------------------------------------------------------- 1 | # See http://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # Compiled output 4 | /dist 5 | /tmp 6 | /out-tsc 7 | /bazel-out 8 | 9 | # Node 10 | /node_modules 11 | npm-debug.log 12 | yarn-error.log 13 | 14 | # IDEs and editors 15 | .idea/ 16 | .project 17 | .classpath 18 | .c9/ 19 | *.launch 20 | .settings/ 21 | *.sublime-workspace 22 | 23 | # Visual Studio Code 24 | .vscode/* 25 | !.vscode/settings.json 26 | !.vscode/tasks.json 27 | !.vscode/launch.json 28 | !.vscode/extensions.json 29 | .history/* 30 | 31 | # Miscellaneous 32 | /.angular/cache 33 | .sass-cache/ 34 | /connect.lock 35 | /coverage 36 | /libpeerconnection.log 37 | testem.log 38 | /typings 39 | 40 | # System files 41 | .DS_Store 42 | Thumbs.db 43 | -------------------------------------------------------------------------------- /todoList/.gitignore: -------------------------------------------------------------------------------- 1 | # See http://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # Compiled output 4 | /dist 5 | /tmp 6 | /out-tsc 7 | /bazel-out 8 | 9 | # Node 10 | /node_modules 11 | npm-debug.log 12 | yarn-error.log 13 | 14 | # IDEs and editors 15 | .idea/ 16 | .project 17 | .classpath 18 | .c9/ 19 | *.launch 20 | .settings/ 21 | *.sublime-workspace 22 | 23 | # Visual Studio Code 24 | .vscode/* 25 | !.vscode/settings.json 26 | !.vscode/tasks.json 27 | !.vscode/launch.json 28 | !.vscode/extensions.json 29 | .history/* 30 | 31 | # Miscellaneous 32 | /.angular/cache 33 | .sass-cache/ 34 | /connect.lock 35 | /coverage 36 | /libpeerconnection.log 37 | testem.log 38 | /typings 39 | 40 | # System files 41 | .DS_Store 42 | Thumbs.db 43 | -------------------------------------------------------------------------------- /fb-login-page-routing/src/app/profile/profile.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { ProfileComponent } from './profile.component'; 4 | 5 | describe('ProfileComponent', () => { 6 | let component: ProfileComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | declarations: [ ProfileComponent ] 12 | }) 13 | .compileComponents(); 14 | 15 | fixture = TestBed.createComponent(ProfileComponent); 16 | component = fixture.componentInstance; 17 | fixture.detectChanges(); 18 | }); 19 | 20 | it('should create', () => { 21 | expect(component).toBeTruthy(); 22 | }); 23 | }); 24 | -------------------------------------------------------------------------------- /todoList/src/app/todo-list/todo-list.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { TodoListComponent } from './todo-list.component'; 4 | 5 | describe('TodoListComponent', () => { 6 | let component: TodoListComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | declarations: [ TodoListComponent ] 12 | }) 13 | .compileComponents(); 14 | 15 | fixture = TestBed.createComponent(TodoListComponent); 16 | component = fixture.componentInstance; 17 | fixture.detectChanges(); 18 | }); 19 | 20 | it('should create', () => { 21 | expect(component).toBeTruthy(); 22 | }); 23 | }); 24 | -------------------------------------------------------------------------------- /Crud-using-Services/.gitignore: -------------------------------------------------------------------------------- 1 | # See http://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # Compiled output 4 | /dist 5 | /tmp 6 | /out-tsc 7 | /bazel-out 8 | 9 | # Node 10 | /node_modules 11 | npm-debug.log 12 | yarn-error.log 13 | 14 | # IDEs and editors 15 | .idea/ 16 | .project 17 | .classpath 18 | .c9/ 19 | *.launch 20 | .settings/ 21 | *.sublime-workspace 22 | 23 | # Visual Studio Code 24 | .vscode/* 25 | !.vscode/settings.json 26 | !.vscode/tasks.json 27 | !.vscode/launch.json 28 | !.vscode/extensions.json 29 | .history/* 30 | 31 | # Miscellaneous 32 | /.angular/cache 33 | .sass-cache/ 34 | /connect.lock 35 | /coverage 36 | /libpeerconnection.log 37 | testem.log 38 | /typings 39 | 40 | # System files 41 | .DS_Store 42 | Thumbs.db 43 | -------------------------------------------------------------------------------- /fb-login-page-routing/.gitignore: -------------------------------------------------------------------------------- 1 | # See http://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # Compiled output 4 | /dist 5 | /tmp 6 | /out-tsc 7 | /bazel-out 8 | 9 | # Node 10 | /node_modules 11 | npm-debug.log 12 | yarn-error.log 13 | 14 | # IDEs and editors 15 | .idea/ 16 | .project 17 | .classpath 18 | .c9/ 19 | *.launch 20 | .settings/ 21 | *.sublime-workspace 22 | 23 | # Visual Studio Code 24 | .vscode/* 25 | !.vscode/settings.json 26 | !.vscode/tasks.json 27 | !.vscode/launch.json 28 | !.vscode/extensions.json 29 | .history/* 30 | 31 | # Miscellaneous 32 | /.angular/cache 33 | .sass-cache/ 34 | /connect.lock 35 | /coverage 36 | /libpeerconnection.log 37 | testem.log 38 | /typings 39 | 40 | # System files 41 | .DS_Store 42 | Thumbs.db 43 | -------------------------------------------------------------------------------- /firstapp/src/app/beverages/beverages.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { BeveragesComponent } from './beverages.component'; 4 | 5 | describe('BeveragesComponent', () => { 6 | let component: BeveragesComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | declarations: [ BeveragesComponent ] 12 | }) 13 | .compileComponents(); 14 | 15 | fixture = TestBed.createComponent(BeveragesComponent); 16 | component = fixture.componentInstance; 17 | fixture.detectChanges(); 18 | }); 19 | 20 | it('should create', () => { 21 | expect(component).toBeTruthy(); 22 | }); 23 | }); 24 | -------------------------------------------------------------------------------- /firstapp/src/app/user-routing.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule,Component } from '@angular/core'; 2 | import { RouterModule, Routes } from '@angular/router'; 3 | import { SavingAccComponent } from './user/saving-acc/saving-acc.component'; 4 | import { CurrentAccComponent } from './user/current-acc/current-acc.component'; 5 | 6 | 7 | const UserRoutes: Routes = [ 8 | { path: 'user/saving', component: SavingAccComponent }, 9 | { path: 'user/current', component: CurrentAccComponent } 10 | ]; 11 | 12 | @NgModule({ 13 | declarations: [ 14 | SavingAccComponent, 15 | CurrentAccComponent 16 | ], 17 | imports: [ 18 | RouterModule.forChild(UserRoutes), 19 | ], 20 | exports: [ 21 | RouterModule 22 | ] 23 | }) 24 | export class UserRoutingModule { } 25 | -------------------------------------------------------------------------------- /firstapp/src/app/view-child/view-child.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { ViewChildComponent } from './view-child.component'; 4 | 5 | describe('ViewChildComponent', () => { 6 | let component: ViewChildComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | declarations: [ ViewChildComponent ] 12 | }) 13 | .compileComponents(); 14 | 15 | fixture = TestBed.createComponent(ViewChildComponent); 16 | component = fixture.componentInstance; 17 | fixture.detectChanges(); 18 | }); 19 | 20 | it('should create', () => { 21 | expect(component).toBeTruthy(); 22 | }); 23 | }); 24 | -------------------------------------------------------------------------------- /FoodOrder_App/Food_order/.gitignore: -------------------------------------------------------------------------------- 1 | # See http://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # Compiled output 4 | /dist 5 | /tmp 6 | /out-tsc 7 | /bazel-out 8 | 9 | # Node 10 | /node_modules 11 | npm-debug.log 12 | yarn-error.log 13 | 14 | # IDEs and editors 15 | .idea/ 16 | .project 17 | .classpath 18 | .c9/ 19 | *.launch 20 | .settings/ 21 | *.sublime-workspace 22 | 23 | # Visual Studio Code 24 | .vscode/* 25 | !.vscode/settings.json 26 | !.vscode/tasks.json 27 | !.vscode/launch.json 28 | !.vscode/extensions.json 29 | .history/* 30 | 31 | # Miscellaneous 32 | /.angular/cache 33 | .sass-cache/ 34 | /connect.lock 35 | /coverage 36 | /libpeerconnection.log 37 | testem.log 38 | /typings 39 | 40 | # System files 41 | .DS_Store 42 | Thumbs.db 43 | -------------------------------------------------------------------------------- /FoodOrder_App/Food_order/src/environments/environment.ts: -------------------------------------------------------------------------------- 1 | // This file can be replaced during build by using the `fileReplacements` array. 2 | // `ng build` replaces `environment.ts` with `environment.prod.ts`. 3 | // The list of file replacements can be found in `angular.json`. 4 | 5 | export const environment = { 6 | production: false 7 | }; 8 | 9 | /* 10 | * For easier debugging in development mode, you can import the following file 11 | * to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`. 12 | * 13 | * This import should be commented out in production mode because it will have a negative impact 14 | * on performance if an error is thrown. 15 | */ 16 | // import 'zone.js/plugins/zone-error'; // Included with Angular CLI. 17 | -------------------------------------------------------------------------------- /firstapp/src/app/child-lifecycle-hooks/child-lifecycle-hooks.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, DoCheck, Input, OnChanges, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-child-lifecycle-hooks', 5 | templateUrl: './child-lifecycle-hooks.component.html', 6 | styleUrls: ['./child-lifecycle-hooks.component.css'] 7 | }) 8 | export class ChildLifecycleHooksComponent implements OnInit,OnChanges,DoCheck{ 9 | 10 | @Input() myvalue="" 11 | constructor(){ 12 | console.log("constructor called"); 13 | } 14 | 15 | ngOnInit() { 16 | console.log("ngOnInit called"); 17 | } 18 | 19 | ngOnChanges(){ 20 | console.log("ngOnChanges called"); 21 | } 22 | 23 | ngDoCheck(){ 24 | console.log("ngDoCheck called"); 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /firstapp/src/app/user/saving-acc/saving-acc.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { SavingAccComponent } from './saving-acc.component'; 4 | 5 | describe('SavingAccComponent', () => { 6 | let component: SavingAccComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | declarations: [ SavingAccComponent ] 12 | }) 13 | .compileComponents(); 14 | 15 | fixture = TestBed.createComponent(SavingAccComponent); 16 | component = fixture.componentInstance; 17 | fixture.detectChanges(); 18 | }); 19 | 20 | it('should create', () => { 21 | expect(component).toBeTruthy(); 22 | }); 23 | }); 24 | -------------------------------------------------------------------------------- /FoodOrder_App/Food_order/src/app/components/partial/search/search.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import { ActivatedRoute, Router } from '@angular/router'; 3 | 4 | @Component({ 5 | selector: 'app-search', 6 | templateUrl: './search.component.html', 7 | styleUrls: ['./search.component.css'] 8 | }) 9 | export class SearchComponent implements OnInit { 10 | searchTerm=""; 11 | 12 | constructor(activatedRoute:ActivatedRoute,private router:Router 13 | ) { 14 | activatedRoute.params.subscribe((params)=>{ 15 | if(params['searchTerm'])this.searchTerm=params['searchTerm'] 16 | }) 17 | } 18 | 19 | ngOnInit(): void { 20 | } 21 | search(term:string):void{ 22 | this.router.navigateByUrl('/search/'+term) 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /firstapp/src/app/user/current-acc/current-acc.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { CurrentAccComponent } from './current-acc.component'; 4 | 5 | describe('CurrentAccComponent', () => { 6 | let component: CurrentAccComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | declarations: [ CurrentAccComponent ] 12 | }) 13 | .compileComponents(); 14 | 15 | fixture = TestBed.createComponent(CurrentAccComponent); 16 | component = fixture.componentInstance; 17 | fixture.detectChanges(); 18 | }); 19 | 20 | it('should create', () => { 21 | expect(component).toBeTruthy(); 22 | }); 23 | }); 24 | -------------------------------------------------------------------------------- /FoodOrder_App/Food_order/src/app/components/pages/home/home.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { HomeComponent } from './home.component'; 4 | 5 | describe('HomeComponent', () => { 6 | let component: HomeComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | declarations: [ HomeComponent ] 12 | }) 13 | .compileComponents(); 14 | }); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(HomeComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /FoodOrder_App/Food_order/src/app/components/partial/tags/tags.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { TagsComponent } from './tags.component'; 4 | 5 | describe('TagsComponent', () => { 6 | let component: TagsComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | declarations: [ TagsComponent ] 12 | }) 13 | .compileComponents(); 14 | }); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(TagsComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /FoodOrder_App/backend/src/models/user.model.ts: -------------------------------------------------------------------------------- 1 | import { Schema, model } from "mongoose"; 2 | 3 | export interface User{ 4 | id:string; 5 | email:string; 6 | name:string; 7 | address:string; 8 | token:string; 9 | isAdmin:boolean; 10 | password:string 11 | } 12 | 13 | export const UserSchema=new Schema({ 14 | name:{type:String,required:true}, 15 | email:{type:String,required:true,unique:true}, 16 | password:{type:String,required:true}, 17 | address:{type:String,required:true}, 18 | isAdmin:{type:Boolean,required:true} 19 | 20 | }, 21 | { 22 | timestamps:true, 23 | toJSON:{ 24 | virtuals:true 25 | }, 26 | toObject:{ 27 | virtuals:true 28 | } 29 | }) 30 | export const UserModel=model('user',UserSchema) -------------------------------------------------------------------------------- /FoodOrder_App/Food_order/src/app/components/partial/search/search.component.css: -------------------------------------------------------------------------------- 1 | div 2 | { 3 | display: flex; 4 | justify-content: center; 5 | margin-top: 3rem; 6 | margin-bottom:1.6rem ; 7 | } 8 | input{ 9 | border-radius: 10rem 0 0 10rem; 10 | border: none; 11 | height: 3rem; 12 | width: 20rem; 13 | background-color: rgb(243, 243, 243); 14 | padding: 1.2rem; 15 | font-size: 1rem; 16 | font-weight: 500; 17 | outline: none; 18 | 19 | } 20 | div button{ 21 | color: grey; 22 | height: 3rem; 23 | width: 5rem; 24 | font-size: 1rem; 25 | border-radius: 0 10rem 10rem 0; 26 | border: none; 27 | background-color: #e72929; 28 | color: white; 29 | opacity: 0.8; 30 | outline: none; 31 | } 32 | div button:hover{ 33 | opacity: 1; 34 | cursor: pointer; 35 | } 36 | -------------------------------------------------------------------------------- /FoodOrder_App/backend/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "backend", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "start": "cd src && nodemon server.ts", 8 | "test": "echo \"Error: no test specified\" && exit 1" 9 | }, 10 | "author": "", 11 | "license": "ISC", 12 | "dependencies": { 13 | "cors": "^2.8.5", 14 | "dotenv": "^16.1.4", 15 | "express": "^4.18.2", 16 | "express-async-handler": "^1.2.0", 17 | "jsonwebtoken": "^9.0.0", 18 | "mongoose": "^7.2.2", 19 | "typescript": "^5.0.4" 20 | }, 21 | "devDependencies": { 22 | "@types/cors": "^2.8.13", 23 | "@types/express": "^4.17.17", 24 | "@types/jsonwebtoken": "^9.0.2", 25 | "nodemon": "^2.0.22", 26 | "ts-node": "^10.9.1" 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /FoodOrder_App/Food_order/src/app/components/pages/login/login.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { LoginComponent } from './login.component'; 4 | 5 | describe('LoginComponent', () => { 6 | let component: LoginComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | declarations: [ LoginComponent ] 12 | }) 13 | .compileComponents(); 14 | }); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(LoginComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /FoodOrder_App/Food_order/src/app/components/partial/title/title.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { TitleComponent } from './title.component'; 4 | 5 | describe('TitleComponent', () => { 6 | let component: TitleComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | declarations: [ TitleComponent ] 12 | }) 13 | .compileComponents(); 14 | }); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(TitleComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /firstapp/src/app/view-child/view-child.component.html: -------------------------------------------------------------------------------- 1 |

Change my color

2 |
3 | Change Color: 4 | Green 5 | Red 6 | Cyan 7 |
8 | 9 |

10 | 11 |
12 |
Counter Tab
13 |
14 | 15 | 16 | 17 |
18 |
19 |

20 | 21 | 22 | -------------------------------------------------------------------------------- /FoodOrder_App/Food_order/src/app/components/partial/header/header.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { HeaderComponent } from './header.component'; 4 | 5 | describe('HeaderComponent', () => { 6 | let component: HeaderComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | declarations: [ HeaderComponent ] 12 | }) 13 | .compileComponents(); 14 | }); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(HeaderComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /FoodOrder_App/Food_order/src/app/components/partial/search/search.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { SearchComponent } from './search.component'; 4 | 5 | describe('SearchComponent', () => { 6 | let component: SearchComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | declarations: [ SearchComponent ] 12 | }) 13 | .compileComponents(); 14 | }); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(SearchComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /fb-login-page-routing/src/app/forgot-password/forgot-password.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { ForgotPasswordComponent } from './forgot-password.component'; 4 | 5 | describe('ForgotPasswordComponent', () => { 6 | let component: ForgotPasswordComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | declarations: [ ForgotPasswordComponent ] 12 | }) 13 | .compileComponents(); 14 | 15 | fixture = TestBed.createComponent(ForgotPasswordComponent); 16 | component = fixture.componentInstance; 17 | fixture.detectChanges(); 18 | }); 19 | 20 | it('should create', () => { 21 | expect(component).toBeTruthy(); 22 | }); 23 | }); 24 | -------------------------------------------------------------------------------- /Crud-using-Services/src/app/api.service.ts: -------------------------------------------------------------------------------- 1 | import { HttpClient } from '@angular/common/http'; 2 | import { Injectable } from '@angular/core'; 3 | 4 | @Injectable({ 5 | providedIn: 'root' 6 | }) 7 | export class ApiService { 8 | 9 | constructor(private http:HttpClient) { } 10 | 11 | PostAllStudentData(data:any){ 12 | return this.http.post("http://localhost:3000/StudentData",data) 13 | } 14 | 15 | GetAllStudentData(){ 16 | return this.http.get("http://localhost:3000/StudentData") 17 | } 18 | 19 | //delete 20 | DeleteStudent(id:number){ 21 | return this.http.delete("http://localhost:3000/StudentData/"+id) 22 | } 23 | 24 | //update 25 | UpdateStudentData(id:number,data:any){ 26 | return this.http.put("http://localhost:3000/StudentData/"+data.id,data) 27 | } 28 | } 29 | 30 | -------------------------------------------------------------------------------- /FoodOrder_App/Food_order/src/app/components/pages/cart-page/cart-page.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { CartPageComponent } from './cart-page.component'; 4 | 5 | describe('CartPageComponent', () => { 6 | let component: CartPageComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | declarations: [ CartPageComponent ] 12 | }) 13 | .compileComponents(); 14 | }); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(CartPageComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /FoodOrder_App/Food_order/src/app/components/pages/food-page/food-page.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { FoodPageComponent } from './food-page.component'; 4 | 5 | describe('FoodPageComponent', () => { 6 | let component: FoodPageComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | declarations: [ FoodPageComponent ] 12 | }) 13 | .compileComponents(); 14 | }); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(FoodPageComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /FoodOrder_App/Food_order/src/app/components/partial/not-found/not-found.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { NotFoundComponent } from './not-found.component'; 4 | 5 | describe('NotFoundComponent', () => { 6 | let component: NotFoundComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | declarations: [ NotFoundComponent ] 12 | }) 13 | .compileComponents(); 14 | }); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(NotFoundComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /FoodOrder_App/Food_order/src/app/components/partial/validations/validations.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { ValidationsComponent } from './validations.component'; 4 | 5 | describe('ValidationsComponent', () => { 6 | let component: ValidationsComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | declarations: [ ValidationsComponent ] 12 | }) 13 | .compileComponents(); 14 | }); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(ValidationsComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /FoodOrder_App/backend/src/router/user.router.ts: -------------------------------------------------------------------------------- 1 | import {Router} from 'express' 2 | import { sample_users } from '../data'; 3 | import jwt from 'jsonwebtoken' 4 | 5 | const router=Router() 6 | 7 | 8 | router.post("/login", (req, res) => { 9 | const { email, password } = req.body; 10 | const user = sample_users.find(user => user.email === email && 11 | user.password === password) 12 | 13 | if(user){ 14 | res.send(generateTokenResponse(user)) 15 | }else{ 16 | res.status(400).send("user name or password is not valid!") 17 | } 18 | 19 | }) 20 | const generateTokenResponse=(user:any)=>{ 21 | const token =jwt.sign({ 22 | email:user.email,isAdmin:user.isAdmin 23 | },"SomeRandomText",{ 24 | expiresIn:"30d" 25 | }) 26 | user.token=token 27 | return user 28 | } 29 | export default router -------------------------------------------------------------------------------- /firstapp/src/app/child-lifecycle-hooks/child-lifecycle-hooks.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { ChildLifecycleHooksComponent } from './child-lifecycle-hooks.component'; 4 | 5 | describe('ChildLifecycleHooksComponent', () => { 6 | let component: ChildLifecycleHooksComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | declarations: [ ChildLifecycleHooksComponent ] 12 | }) 13 | .compileComponents(); 14 | 15 | fixture = TestBed.createComponent(ChildLifecycleHooksComponent); 16 | component = fixture.componentInstance; 17 | fixture.detectChanges(); 18 | }); 19 | 20 | it('should create', () => { 21 | expect(component).toBeTruthy(); 22 | }); 23 | }); 24 | -------------------------------------------------------------------------------- /firstapp/src/app/parent-lifecycle-hooks/parent-lifecycle-hooks.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { ParentLifecycleHooksComponent } from './parent-lifecycle-hooks.component'; 4 | 5 | describe('ParentLifecycleHooksComponent', () => { 6 | let component: ParentLifecycleHooksComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | declarations: [ ParentLifecycleHooksComponent ] 12 | }) 13 | .compileComponents(); 14 | 15 | fixture = TestBed.createComponent(ParentLifecycleHooksComponent); 16 | component = fixture.componentInstance; 17 | fixture.detectChanges(); 18 | }); 19 | 20 | it('should create', () => { 21 | expect(component).toBeTruthy(); 22 | }); 23 | }); 24 | -------------------------------------------------------------------------------- /FoodOrder_App/Food_order/src/app/components/partial/input-container/input-container.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { InputContainerComponent } from './input-container.component'; 4 | 5 | describe('InputContainerComponent', () => { 6 | let component: InputContainerComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | declarations: [ InputContainerComponent ] 12 | }) 13 | .compileComponents(); 14 | }); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(InputContainerComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /FoodOrder_App/Food_order/src/test.ts: -------------------------------------------------------------------------------- 1 | // This file is required by karma.conf.js and loads recursively all the .spec and framework files 2 | 3 | import 'zone.js/testing'; 4 | import { getTestBed } from '@angular/core/testing'; 5 | import { 6 | BrowserDynamicTestingModule, 7 | platformBrowserDynamicTesting 8 | } from '@angular/platform-browser-dynamic/testing'; 9 | 10 | declare const require: { 11 | context(path: string, deep?: boolean, filter?: RegExp): { 12 | (id: string): T; 13 | keys(): string[]; 14 | }; 15 | }; 16 | 17 | // First, initialize the Angular testing environment. 18 | getTestBed().initTestEnvironment( 19 | BrowserDynamicTestingModule, 20 | platformBrowserDynamicTesting(), 21 | ); 22 | 23 | // Then we find all the tests. 24 | const context = require.context('./', true, /\.spec\.ts$/); 25 | // And load the modules. 26 | context.keys().map(context); 27 | -------------------------------------------------------------------------------- /todoList/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BootNgMaterial 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /FoodOrder_App/Food_order/src/app/components/partial/header/header.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | 4 | 27 |
28 |
29 | -------------------------------------------------------------------------------- /fb-login-page-routing/src/app/app.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { BrowserModule } from '@angular/platform-browser'; 3 | 4 | import { AppRoutingModule } from './app-routing.module'; 5 | import { AppComponent } from './app.component'; 6 | import { LoginComponent } from './login/login.component'; 7 | import { SignupComponent } from './signup/signup.component'; 8 | import { ForgotPasswordComponent } from './forgot-password/forgot-password.component'; 9 | import { ProfileComponent } from './profile/profile.component'; 10 | 11 | @NgModule({ 12 | declarations: [ 13 | AppComponent, 14 | LoginComponent, 15 | SignupComponent, 16 | ForgotPasswordComponent, 17 | ProfileComponent 18 | ], 19 | imports: [ 20 | BrowserModule, 21 | AppRoutingModule 22 | ], 23 | providers: [], 24 | bootstrap: [AppComponent] 25 | }) 26 | export class AppModule { } 27 | -------------------------------------------------------------------------------- /fb-login-page-routing/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | FB Login Page 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /FoodOrder_App/Food_order/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | FoodOrder 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /01 JavaScript/ifelse.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | IfElse 8 | 9 | 10 |

If Else

11 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /fb-login-page-routing/src/app/forgot-password/forgot-password.component.html: -------------------------------------------------------------------------------- 1 |
2 |
Password Reset
3 |
4 |

5 | Enter your email address and we'll send you an email with instructions to reset your password. 6 |

7 |
8 | 9 |
10 | Reset password 11 | 14 |
15 |
16 | 17 | -------------------------------------------------------------------------------- /fb-login-page-routing/src/app/login/login.component.css: -------------------------------------------------------------------------------- 1 | /* .card{ 2 | width:60%; 3 | height:300px; 4 | margin-top:50px; 5 | margin-left:10px; 6 | border:none; 7 | box-shadow:3px 3px 3px lightgray; 8 | } */ 9 | 10 | .card-body{ 11 | padding:30px; 12 | margin-top:50px; 13 | margin-right:10px; 14 | } 15 | 16 | div{ 17 | margin-bottom: 20px; 18 | } 19 | 20 | /* style="padding: 30px; margin-top: 50px; margin-right: 10px;" */ 21 | input{ 22 | width:80%; 23 | height:40px; 24 | padding:20px; 25 | margin:20px; 26 | } 27 | 28 | #sub{ 29 | width:40%; 30 | height:40px; 31 | padding:5px; 32 | margin-bottom:20px; 33 | text-align: center; 34 | background-color:rgb(45, 120, 149); 35 | color:white; 36 | border-radius:5px; 37 | } 38 | 39 | a{ 40 | margin:10px; 41 | padding:30px; 42 | text-align: center; 43 | text-decoration:underline; 44 | margin-top: 30px; 45 | padding-top: 60px; 46 | } -------------------------------------------------------------------------------- /FoodOrder_App/Food_order/src/app/app-routing.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { RouterModule, Routes } from '@angular/router'; 3 | import { CartPageComponent } from './components/pages/cart-page/cart-page.component'; 4 | import { FoodPageComponent } from './components/pages/food-page/food-page.component'; 5 | import { HomeComponent } from './components/pages/home/home.component'; 6 | import { LoginComponent } from './components/pages/login/login.component'; 7 | 8 | const routes: Routes = [ 9 | { path: '', component: HomeComponent }, 10 | { path: 'search/:searchItem', component: HomeComponent }, 11 | { path: 'tag/:tag', component: HomeComponent }, 12 | { path: 'food/:id', component: FoodPageComponent }, 13 | { path: 'cart-page', component: CartPageComponent }, 14 | { path: 'login', component: LoginComponent } 15 | ]; 16 | 17 | @NgModule({ 18 | imports: [RouterModule.forRoot(routes)], 19 | exports: [RouterModule] 20 | }) 21 | export class AppRoutingModule { } 22 | -------------------------------------------------------------------------------- /FoodOrder_App/Food_order/src/app/components/partial/header/header.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import { CartService } from 'src/app/services/cart.service'; 3 | import { UserService } from 'src/app/services/user.service'; 4 | import { User } from 'user'; 5 | 6 | @Component({ 7 | selector: 'app-header', 8 | templateUrl: './header.component.html', 9 | styleUrls: ['./header.component.css'] 10 | }) 11 | export class HeaderComponent implements OnInit { 12 | cartQuantity=0; 13 | user!:User 14 | constructor(private cartService:CartService, private userservice:UserService) { 15 | cartService.getCartObservable().subscribe((newcart)=>{ 16 | this.cartQuantity=newcart.totalCount 17 | }) 18 | userservice.userObservable.subscribe((newUser)=>{ 19 | this.user=newUser 20 | }) 21 | } 22 | logout(){ 23 | this.userservice.logOut(); 24 | } 25 | ngOnInit(): void { 26 | } 27 | get isAuth(){ 28 | return this.user.token 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /fb-login-page-routing/src/app/app-routing.module.ts: -------------------------------------------------------------------------------- 1 | import { AuthGuard } from './../../../firstapp/src/app/auth.guard'; 2 | import { NgModule } from '@angular/core'; 3 | import { RouterModule, Routes } from '@angular/router'; 4 | import { ForgotPasswordComponent } from './forgot-password/forgot-password.component'; 5 | import { LoginComponent } from './login/login.component'; 6 | import { SignupComponent } from './signup/signup.component'; 7 | import { ProfileComponent } from './profile/profile.component'; 8 | 9 | 10 | const routes: Routes = [ 11 | { path: '', redirectTo: '/login', pathMatch: 'full' }, 12 | { path: 'login', component:LoginComponent }, 13 | { path: 'signup', component:SignupComponent }, 14 | { path: 'forgot', component:ForgotPasswordComponent }, 15 | { path: 'profile',canActivate:[AuthGuard],component:ProfileComponent } 16 | 17 | ]; 18 | 19 | @NgModule({ 20 | imports: [RouterModule.forRoot(routes)], 21 | exports: [RouterModule] 22 | }) 23 | export class AppRoutingModule { } 24 | -------------------------------------------------------------------------------- /FoodOrder_App/Food_order/src/app/components/pages/cart-page/cart-page.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import { Cart } from 'Cart'; 3 | import { CartItem } from 'CartItems'; 4 | import { CartService } from 'src/app/services/cart.service'; 5 | 6 | @Component({ 7 | selector: 'app-cart-page', 8 | templateUrl: './cart-page.component.html', 9 | styleUrls: ['./cart-page.component.css'] 10 | }) 11 | export class CartPageComponent implements OnInit { 12 | cart!:Cart; 13 | constructor(private cartService:CartService) { 14 | this.cartService.getCartObservable().subscribe((cart)=>{ 15 | this.cart=cart; 16 | }) 17 | } 18 | 19 | ngOnInit(): void { 20 | } 21 | removeFromCart(cartItem:CartItem){ 22 | this.cartService.removeFromCart(cartItem.food.id) 23 | } 24 | 25 | changeQuantity(cartItem:CartItem,quantityInString:string){ 26 | const quantity=parseInt(quantityInString); 27 | this.cartService.changeQuantity(cartItem.food.id,quantity) 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /FoodOrder_App/backend/src/models/food.model.ts: -------------------------------------------------------------------------------- 1 | import { Schema, model } from "mongoose"; 2 | 3 | export interface Food{ 4 | id:string ; 5 | name:string; 6 | price:number; 7 | tags?:string[]; 8 | favorite:boolean; 9 | stars:number; 10 | imageUrl:string; 11 | origins:string[]; 12 | cookTime:string; 13 | } 14 | export const FoodSchema=new Schema( 15 | { 16 | name:{type:String, required:true}, 17 | price:{type:Number, required:true}, 18 | tags:{type:[String]}, 19 | favorite:{type:Boolean, required:false}, 20 | stars:{type:Number, required:true}, 21 | imageUrl:{type:String, required:true}, 22 | origins:{type:[String], required:true}, 23 | cookTime:{type:String, required:true} 24 | },{ 25 | toJSON:{ 26 | virtuals:true 27 | }, 28 | toObject:{ 29 | virtuals:true 30 | }, 31 | timestamps:true 32 | } 33 | ) 34 | export const FoodModel=model('food',FoodSchema) -------------------------------------------------------------------------------- /FoodOrder_App/Food_order/tsconfig.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "compileOnSave": false, 4 | "compilerOptions": { 5 | "baseUrl": "./", 6 | "outDir": "./dist/out-tsc", 7 | "forceConsistentCasingInFileNames": true, 8 | "strict": true, 9 | "noImplicitOverride": true, 10 | "noPropertyAccessFromIndexSignature": true, 11 | "noImplicitReturns": true, 12 | "noFallthroughCasesInSwitch": true, 13 | "sourceMap": true, 14 | "declaration": false, 15 | "downlevelIteration": true, 16 | "experimentalDecorators": true, 17 | "moduleResolution": "node", 18 | "importHelpers": true, 19 | "target": "es2017", 20 | "module": "es2020", 21 | "lib": [ 22 | "es2020", 23 | "dom" 24 | ] 25 | }, 26 | "angularCompilerOptions": { 27 | "enableI18nLegacyMessageIdFormat": false, 28 | "strictInjectionParameters": true, 29 | "strictInputAccessModifiers": true, 30 | "strictTemplates": true 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /FoodOrder_App/Food_order/src/app/components/pages/login/login.component.css: -------------------------------------------------------------------------------- 1 | .container{ 2 | display: flex; 3 | justify-content: center; 4 | align-items: center; 5 | height: 100%; 6 | margin-top: 3rem; 7 | } 8 | .details{ 9 | width:28rem; 10 | box-shadow: 10px 10px 10px lightgray; 11 | } 12 | form{ 13 | display: flex; 14 | align-items: center; 15 | flex-direction: column; 16 | } 17 | .input-container label{ 18 | font-size: 20px; 19 | padding: 10px; 20 | 21 | } 22 | input{ 23 | width: 400px; 24 | height: 60px; 25 | border-radius: 5px; 26 | outline: none; 27 | padding: 20px; 28 | } 29 | .button{ 30 | margin-top: 25px; 31 | } 32 | button{ 33 | width: 80px; 34 | outline: none; 35 | border: none; 36 | color: white; 37 | background-color: rgb(8, 184, 243); 38 | margin-bottom: 20px; 39 | padding: 10px; 40 | font-size: 18px; 41 | font-weight: bold; 42 | border-radius: 4px; 43 | } 44 | .err{ 45 | color: red; 46 | } -------------------------------------------------------------------------------- /FoodOrder_App/backend/src/router/food.router.ts: -------------------------------------------------------------------------------- 1 | import { Router } from "express"; 2 | import { Sample_Food, sample_tags, sample_users } from "../data"; 3 | 4 | const router=Router() 5 | 6 | router.get("/", (req, res) => { 7 | res.send(Sample_Food) 8 | }); 9 | 10 | router.get("/search/:searchTerm", (req, res) => { 11 | const searchTerm = req.params.searchTerm; 12 | const foods = Sample_Food.filter(food => food.name.toLowerCase() 13 | .includes(searchTerm.toLowerCase())); 14 | res.send(foods) 15 | }); 16 | 17 | router.get("/tags", (req, res) => { 18 | res.send(sample_tags) 19 | 20 | }); 21 | 22 | router.get("/tag/:tagName", (req, res) => { 23 | const tagName = req.params.tagName; 24 | const foods = Sample_Food.filter(food => food.tags?.includes(tagName)); 25 | res.send(foods) 26 | }); 27 | 28 | router.get("/:foodId", (req, res) => { 29 | const foodId = req.params.foodId; 30 | const food = Sample_Food.find(food => food.id == foodId); 31 | res.send(food) 32 | }); 33 | export default router -------------------------------------------------------------------------------- /firstapp/tsconfig.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "compileOnSave": false, 4 | "compilerOptions": { 5 | "baseUrl": "./", 6 | "outDir": "./dist/out-tsc", 7 | "forceConsistentCasingInFileNames": true, 8 | "strict": true, 9 | "noImplicitOverride": true, 10 | "noPropertyAccessFromIndexSignature": true, 11 | "noImplicitReturns": true, 12 | "noFallthroughCasesInSwitch": true, 13 | "sourceMap": true, 14 | "declaration": false, 15 | "downlevelIteration": true, 16 | "experimentalDecorators": true, 17 | "moduleResolution": "node", 18 | "importHelpers": true, 19 | "target": "ES2022", 20 | "module": "ES2022", 21 | "useDefineForClassFields": false, 22 | "lib": [ 23 | "ES2022", 24 | "dom" 25 | ] 26 | }, 27 | "angularCompilerOptions": { 28 | "enableI18nLegacyMessageIdFormat": false, 29 | "strictInjectionParameters": true, 30 | "strictInputAccessModifiers": true, 31 | "strictTemplates": true 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /todoList/tsconfig.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "compileOnSave": false, 4 | "compilerOptions": { 5 | "baseUrl": "./", 6 | "outDir": "./dist/out-tsc", 7 | "forceConsistentCasingInFileNames": true, 8 | "strict": true, 9 | "noImplicitOverride": true, 10 | "noPropertyAccessFromIndexSignature": true, 11 | "noImplicitReturns": true, 12 | "noFallthroughCasesInSwitch": true, 13 | "sourceMap": true, 14 | "declaration": false, 15 | "downlevelIteration": true, 16 | "experimentalDecorators": true, 17 | "moduleResolution": "node", 18 | "importHelpers": true, 19 | "target": "ES2022", 20 | "module": "ES2022", 21 | "useDefineForClassFields": false, 22 | "lib": [ 23 | "ES2022", 24 | "dom" 25 | ] 26 | }, 27 | "angularCompilerOptions": { 28 | "enableI18nLegacyMessageIdFormat": false, 29 | "strictInjectionParameters": true, 30 | "strictInputAccessModifiers": true, 31 | "strictTemplates": true 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /firstapp/src/app/view-child/view-child.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, ViewChild } from '@angular/core'; 2 | import { DemoDirectiveDirective } from '../demo-directive.directive'; 3 | import { CounterComponent } from '../counter/counter.component'; 4 | 5 | @Component({ 6 | selector: 'app-view-child', 7 | templateUrl: './view-child.component.html', 8 | styleUrls: ['./view-child.component.css'] 9 | }) 10 | export class ViewChildComponent implements OnInit { 11 | @ViewChild( DemoDirectiveDirective ) 12 | demoDirectiveDirective : DemoDirectiveDirective | undefined; 13 | 14 | constructor(){} 15 | 16 | ngOnInit(): void {} 17 | 18 | changeColor(color:string){ 19 | this.demoDirectiveDirective?.change(color); 20 | } 21 | 22 | //countercomponent viewchild 23 | @ViewChild( CounterComponent ) 24 | counterComponent : CounterComponent | undefined; 25 | 26 | inc(){ 27 | this.counterComponent?.increasebyone(); 28 | } 29 | 30 | dec(){ 31 | this.counterComponent?.decreasebyone(); 32 | } 33 | 34 | 35 | 36 | 37 | } 38 | -------------------------------------------------------------------------------- /Crud-using-Services/tsconfig.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "compileOnSave": false, 4 | "compilerOptions": { 5 | "baseUrl": "./", 6 | "outDir": "./dist/out-tsc", 7 | "forceConsistentCasingInFileNames": true, 8 | "strict": true, 9 | "noImplicitOverride": true, 10 | "noPropertyAccessFromIndexSignature": true, 11 | "noImplicitReturns": true, 12 | "noFallthroughCasesInSwitch": true, 13 | "sourceMap": true, 14 | "declaration": false, 15 | "downlevelIteration": true, 16 | "experimentalDecorators": true, 17 | "moduleResolution": "node", 18 | "importHelpers": true, 19 | "target": "ES2022", 20 | "module": "ES2022", 21 | "useDefineForClassFields": false, 22 | "lib": [ 23 | "ES2022", 24 | "dom" 25 | ] 26 | }, 27 | "angularCompilerOptions": { 28 | "enableI18nLegacyMessageIdFormat": false, 29 | "strictInjectionParameters": true, 30 | "strictInputAccessModifiers": true, 31 | "strictTemplates": true 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /fb-login-page-routing/tsconfig.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "compileOnSave": false, 4 | "compilerOptions": { 5 | "baseUrl": "./", 6 | "outDir": "./dist/out-tsc", 7 | "forceConsistentCasingInFileNames": true, 8 | "strict": true, 9 | "noImplicitOverride": true, 10 | "noPropertyAccessFromIndexSignature": true, 11 | "noImplicitReturns": true, 12 | "noFallthroughCasesInSwitch": true, 13 | "sourceMap": true, 14 | "declaration": false, 15 | "downlevelIteration": true, 16 | "experimentalDecorators": true, 17 | "moduleResolution": "node", 18 | "importHelpers": true, 19 | "target": "ES2022", 20 | "module": "ES2022", 21 | "useDefineForClassFields": false, 22 | "lib": [ 23 | "ES2022", 24 | "dom" 25 | ] 26 | }, 27 | "angularCompilerOptions": { 28 | "enableI18nLegacyMessageIdFormat": false, 29 | "strictInjectionParameters": true, 30 | "strictInputAccessModifiers": true, 31 | "strictTemplates": true 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Crud-using-Services/db.json: -------------------------------------------------------------------------------- 1 | { 2 | "StudentData": [ 3 | { 4 | "name": "Arjun", 5 | "email": "arjun@gmail.com", 6 | "status": "Old Admission", 7 | "msg": "paid", 8 | "course": "full-stack", 9 | "date": "2023-04-27T18:30:00.000Z", 10 | "fees": 4500, 11 | "id": 1 12 | }, 13 | { 14 | "name": "Kittu", 15 | "email": "kittu@gmail.com", 16 | "status": "Current Admission", 17 | "msg": "Half Paid", 18 | "course": "full-stack", 19 | "date": "2023-04-26T18:30:00.000Z", 20 | "fees": 4500, 21 | "id": 2 22 | }, 23 | { 24 | "name": "Kunal", 25 | "email": "Kunal@gmail.com", 26 | "status": "New", 27 | "msg": "Partially Paid", 28 | "course": "mean stack", 29 | "date": "2023-05-29T18:30:00.000Z", 30 | "fees": 10000, 31 | "id": 3 32 | } 33 | ], 34 | "comments": [ 35 | { 36 | "id": 1, 37 | "body": "some comment", 38 | "postId": 1 39 | } 40 | ], 41 | "profile": { 42 | "name": "typicode" 43 | } 44 | } -------------------------------------------------------------------------------- /01 JavaScript/switchCase.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Switch Case 8 | 9 | 10 |

Switch Case

11 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /FoodOrder_App/Food_order/src/app/components/pages/food-page/food-page.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import { ActivatedRoute, Router } from '@angular/router'; 3 | import { Food } from 'Food'; 4 | import { CartService } from 'src/app/services/cart.service'; 5 | import { FoodService } from 'src/app/services/food.service'; 6 | 7 | @Component({ 8 | selector: 'app-food-page', 9 | templateUrl: './food-page.component.html', 10 | styleUrls: ['./food-page.component.css'] 11 | }) 12 | export class FoodPageComponent implements OnInit { 13 | food!:Food; 14 | constructor(activatedRoute:ActivatedRoute,foodService:FoodService, 15 | private cartService:CartService,private router:Router) { 16 | activatedRoute.params.subscribe((params)=>{ 17 | if(params['id']) 18 | foodService.getFoodById(params['id']).subscribe(serverFood=>{ 19 | this.food=serverFood 20 | }) 21 | }) 22 | } 23 | 24 | ngOnInit(): void { 25 | } 26 | addToCart():void{ 27 | this.cartService.addToCart(this.food); 28 | this.router.navigateByUrl("/cart-page") 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /03 notes/ngStyle.txt: -------------------------------------------------------------------------------- 1 | ngStyle 2 | The ngStyle directive lets you set a given DOM elements style properties. 3 |
4 | 5 | ngStyle becomes musch more useful when the value is dynamic. 6 |
7 | 8 | app.component.ts 9 | people:any[]=[ 10 | 11 | { 12 | "name":"vaishanvi", 13 | "country:"India" 14 | }, 15 | { 16 | "name":"Pratiksha", 17 | "country:"UK" 18 | }, 19 | { 20 | "name":"Namrata", 21 | "country:"India" 22 | }, 23 | { 24 | "name":"Khushabu", 25 | "country:"UK" 26 | }, 27 | { 28 | "name":"Janvi", 29 | "country:"India" 30 | }, 31 | { 32 | "name":"Seema", 33 | "country:"UK" 34 | }, 35 | { 36 | "name":"Rutuja", 37 | "country:"India" 38 | } 39 | 40 | ]; 41 | getColor(country){ 42 | switch(country){ 43 | case 'India': 44 | return 'green'; 45 | case 'UK': 46 | return 'blue'; 47 | } 48 | } 49 | } 50 | 51 | app.component.html 52 |
    53 |
  • 54 | {{person.name}}-{{person.country}} 55 | 56 | 57 |
  • 58 |
-------------------------------------------------------------------------------- /Crud-using-Services/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Crud Services 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /firstapp/.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | // For more information, visit: https://go.microsoft.com/fwlink/?LinkId=733558 3 | "version": "2.0.0", 4 | "tasks": [ 5 | { 6 | "type": "npm", 7 | "script": "start", 8 | "isBackground": true, 9 | "problemMatcher": { 10 | "owner": "typescript", 11 | "pattern": "$tsc", 12 | "background": { 13 | "activeOnStart": true, 14 | "beginsPattern": { 15 | "regexp": "(.*?)" 16 | }, 17 | "endsPattern": { 18 | "regexp": "bundle generation complete" 19 | } 20 | } 21 | } 22 | }, 23 | { 24 | "type": "npm", 25 | "script": "test", 26 | "isBackground": true, 27 | "problemMatcher": { 28 | "owner": "typescript", 29 | "pattern": "$tsc", 30 | "background": { 31 | "activeOnStart": true, 32 | "beginsPattern": { 33 | "regexp": "(.*?)" 34 | }, 35 | "endsPattern": { 36 | "regexp": "bundle generation complete" 37 | } 38 | } 39 | } 40 | } 41 | ] 42 | } 43 | -------------------------------------------------------------------------------- /todoList/.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | // For more information, visit: https://go.microsoft.com/fwlink/?LinkId=733558 3 | "version": "2.0.0", 4 | "tasks": [ 5 | { 6 | "type": "npm", 7 | "script": "start", 8 | "isBackground": true, 9 | "problemMatcher": { 10 | "owner": "typescript", 11 | "pattern": "$tsc", 12 | "background": { 13 | "activeOnStart": true, 14 | "beginsPattern": { 15 | "regexp": "(.*?)" 16 | }, 17 | "endsPattern": { 18 | "regexp": "bundle generation complete" 19 | } 20 | } 21 | } 22 | }, 23 | { 24 | "type": "npm", 25 | "script": "test", 26 | "isBackground": true, 27 | "problemMatcher": { 28 | "owner": "typescript", 29 | "pattern": "$tsc", 30 | "background": { 31 | "activeOnStart": true, 32 | "beginsPattern": { 33 | "regexp": "(.*?)" 34 | }, 35 | "endsPattern": { 36 | "regexp": "bundle generation complete" 37 | } 38 | } 39 | } 40 | } 41 | ] 42 | } 43 | -------------------------------------------------------------------------------- /FoodOrder_App/Food_order/src/app/components/partial/header/header.component.css: -------------------------------------------------------------------------------- 1 | header 2 | { 3 | position: relative; 4 | background: white; 5 | padding: 0; 6 | border-bottom: 1px solid red; 7 | } 8 | a{ 9 | color:red; 10 | text-decoration: none; 11 | } 12 | a:hover{ 13 | background-color: #e72929; 14 | color: white; 15 | cursor: pointer; 16 | } 17 | .container{ 18 | margin: 0 auto; 19 | display: flex; 20 | justify-content: space-between; 21 | } 22 | a.logo{ 23 | font-weight: bold; 24 | padding: 1rem; 25 | } 26 | ul{ 27 | display: flex; 28 | list-style-type: none; 29 | margin :0; 30 | } 31 | ul a{ 32 | padding: 1rem; 33 | display: inline-block; 34 | } 35 | a span{ 36 | background: red; 37 | color: white; 38 | padding: 0.1rem 0.45rem; 39 | border-radius: 100rem; 40 | font-size: 0.9rem; 41 | } 42 | .menu-container{ 43 | position:relative; 44 | } 45 | .menu{ 46 | position: absolute; 47 | z-index: 1; 48 | background: whitesmoke; 49 | display: none; 50 | } 51 | .menu-container:hover .menu{ 52 | display: block; 53 | } 54 | .menu a{ 55 | width: 100%; 56 | max-width: 8rem; 57 | } 58 | 59 | -------------------------------------------------------------------------------- /Crud-using-Services/.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | // For more information, visit: https://go.microsoft.com/fwlink/?LinkId=733558 3 | "version": "2.0.0", 4 | "tasks": [ 5 | { 6 | "type": "npm", 7 | "script": "start", 8 | "isBackground": true, 9 | "problemMatcher": { 10 | "owner": "typescript", 11 | "pattern": "$tsc", 12 | "background": { 13 | "activeOnStart": true, 14 | "beginsPattern": { 15 | "regexp": "(.*?)" 16 | }, 17 | "endsPattern": { 18 | "regexp": "bundle generation complete" 19 | } 20 | } 21 | } 22 | }, 23 | { 24 | "type": "npm", 25 | "script": "test", 26 | "isBackground": true, 27 | "problemMatcher": { 28 | "owner": "typescript", 29 | "pattern": "$tsc", 30 | "background": { 31 | "activeOnStart": true, 32 | "beginsPattern": { 33 | "regexp": "(.*?)" 34 | }, 35 | "endsPattern": { 36 | "regexp": "bundle generation complete" 37 | } 38 | } 39 | } 40 | } 41 | ] 42 | } 43 | -------------------------------------------------------------------------------- /fb-login-page-routing/.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | // For more information, visit: https://go.microsoft.com/fwlink/?LinkId=733558 3 | "version": "2.0.0", 4 | "tasks": [ 5 | { 6 | "type": "npm", 7 | "script": "start", 8 | "isBackground": true, 9 | "problemMatcher": { 10 | "owner": "typescript", 11 | "pattern": "$tsc", 12 | "background": { 13 | "activeOnStart": true, 14 | "beginsPattern": { 15 | "regexp": "(.*?)" 16 | }, 17 | "endsPattern": { 18 | "regexp": "bundle generation complete" 19 | } 20 | } 21 | } 22 | }, 23 | { 24 | "type": "npm", 25 | "script": "test", 26 | "isBackground": true, 27 | "problemMatcher": { 28 | "owner": "typescript", 29 | "pattern": "$tsc", 30 | "background": { 31 | "activeOnStart": true, 32 | "beginsPattern": { 33 | "regexp": "(.*?)" 34 | }, 35 | "endsPattern": { 36 | "regexp": "bundle generation complete" 37 | } 38 | } 39 | } 40 | } 41 | ] 42 | } 43 | -------------------------------------------------------------------------------- /firstapp/README.md: -------------------------------------------------------------------------------- 1 | # Firstapp 2 | 3 | This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 15.2.0. 4 | 5 | ## Development server 6 | 7 | Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The application will automatically reload if you change any of the source files. 8 | 9 | ## Code scaffolding 10 | 11 | Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`. 12 | 13 | ## Build 14 | 15 | Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. 16 | 17 | ## Running unit tests 18 | 19 | Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io). 20 | 21 | ## Running end-to-end tests 22 | 23 | Run `ng e2e` to execute the end-to-end tests via a platform of your choice. To use this command, you need to first add a package that implements end-to-end testing capabilities. 24 | 25 | ## Further help 26 | 27 | To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page. 28 | -------------------------------------------------------------------------------- /todoList/README.md: -------------------------------------------------------------------------------- 1 | # BootNgMaterial 2 | 3 | This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 15.2.0. 4 | 5 | ## Development server 6 | 7 | Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The application will automatically reload if you change any of the source files. 8 | 9 | ## Code scaffolding 10 | 11 | Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`. 12 | 13 | ## Build 14 | 15 | Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. 16 | 17 | ## Running unit tests 18 | 19 | Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io). 20 | 21 | ## Running end-to-end tests 22 | 23 | Run `ng e2e` to execute the end-to-end tests via a platform of your choice. To use this command, you need to first add a package that implements end-to-end testing capabilities. 24 | 25 | ## Further help 26 | 27 | To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page. 28 | -------------------------------------------------------------------------------- /FoodOrder_App/Food_order/README.md: -------------------------------------------------------------------------------- 1 | # FoodOrder 2 | 3 | This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 13.1.3. 4 | 5 | ## Development server 6 | 7 | Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files. 8 | 9 | ## Code scaffolding 10 | 11 | Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`. 12 | 13 | ## Build 14 | 15 | Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. 16 | 17 | ## Running unit tests 18 | 19 | Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io). 20 | 21 | ## Running end-to-end tests 22 | 23 | Run `ng e2e` to execute the end-to-end tests via a platform of your choice. To use this command, you need to first add a package that implements end-to-end testing capabilities. 24 | 25 | ## Further help 26 | 27 | To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page. 28 | -------------------------------------------------------------------------------- /FoodOrder_App/Food_order/src/app/services/food.service.ts: -------------------------------------------------------------------------------- 1 | import { HttpClient } from '@angular/common/http'; 2 | import { Injectable } from '@angular/core'; 3 | import { Sample_Food, sample_tags } from 'Data'; 4 | import { Food } from 'Food'; 5 | import { Observable } from 'rxjs'; 6 | import { Tag } from 'src/Tag'; 7 | import { FOODS_BY_ID_URL, FOODS_BY_SEARCH_URL, FOODS_BY_TAG_URL, FOODS_TAG_URL, FOODS_URL } from '../constants/urls'; 8 | 9 | @Injectable({ 10 | providedIn: 'root' 11 | }) 12 | export class FoodService { 13 | 14 | constructor(private http:HttpClient) { } 15 | getAll():Observable{ 16 | return this.http.get(FOODS_URL); 17 | } 18 | getAllFoodBySearch(searchTerm:string){ 19 | return this.http.get(FOODS_BY_SEARCH_URL+ searchTerm); 20 | } 21 | 22 | getAllFoodsByTag(tag:string):Observable { 23 | return tag==="All"? 24 | this.getAll(): 25 | this.http.get(FOODS_BY_TAG_URL +tag ); 26 | } 27 | getFoodById(foodId:string):Observable{ 28 | return this.http.get(FOODS_BY_ID_URL +foodId ); 29 | } 30 | getAllTags():Observable{ 31 | return this.http.get(FOODS_TAG_URL) 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Crud-using-Services/README.md: -------------------------------------------------------------------------------- 1 | # CrudUsingServices 2 | 3 | This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 15.2.0. 4 | 5 | ## Development server 6 | 7 | Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The application will automatically reload if you change any of the source files. 8 | 9 | ## Code scaffolding 10 | 11 | Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`. 12 | 13 | ## Build 14 | 15 | Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. 16 | 17 | ## Running unit tests 18 | 19 | Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io). 20 | 21 | ## Running end-to-end tests 22 | 23 | Run `ng e2e` to execute the end-to-end tests via a platform of your choice. To use this command, you need to first add a package that implements end-to-end testing capabilities. 24 | 25 | ## Further help 26 | 27 | To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page. 28 | -------------------------------------------------------------------------------- /FoodOrder_App/Food_order/src/app/components/pages/home/home.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import { ActivatedRoute } from '@angular/router'; 3 | import { Food } from 'Food'; 4 | import { Observable } from 'rxjs'; 5 | import { FoodService } from 'src/app/services/food.service'; 6 | 7 | @Component({ 8 | selector: 'app-home', 9 | templateUrl: './home.component.html', 10 | styleUrls: ['./home.component.css'] 11 | }) 12 | export class HomeComponent implements OnInit { 13 | foods: Food[] = [] 14 | constructor(private foodservice: FoodService, activatedRoute: ActivatedRoute) { 15 | let foodsObservable: Observable 16 | activatedRoute.params.subscribe((params) => { 17 | if (params['searchTerm']) 18 | foodsObservable = this.foodservice.getAllFoodBySearch(params['searchTerm']) 19 | else if (params['tag']) 20 | foodsObservable = this.foodservice.getAllFoodsByTag(params['tag']) 21 | else 22 | foodsObservable = foodservice.getAll(); 23 | 24 | foodsObservable.subscribe((serverFoods) => { 25 | this.foods = serverFoods 26 | }) 27 | }) 28 | } 29 | 30 | ngOnInit(): void { 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /firstapp/src/app/app-routing.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule} from '@angular/core'; 2 | import { RouterModule, Routes } from '@angular/router'; 3 | 4 | import { HomeComponent } from './home/home.component'; 5 | import { NavComponent } from './nav/nav.component'; 6 | import { AboutComponent } from './about/about.component'; 7 | import { ContactComponent } from './contact/contact.component'; 8 | import { AuthGuard } from './auth.guard'; 9 | import {SavingAccComponent,CurrentAccComponent} from './user/user.module'; 10 | 11 | const routes: Routes = [ 12 | { path:'' ,pathMatch:'full',redirectTo:'home'}, 13 | { path:'home' ,component:HomeComponent}, 14 | { path:'nav',canActivate:[AuthGuard],component: NavComponent}, 15 | { path:'about' ,component:AboutComponent}, 16 | { path:'contact' ,component:ContactComponent}, 17 | { path:'**' ,redirectTo:'home'}, 18 | { path:'admin',loadChildren:()=>import('./admin/admin.module').then(m=>m.AdminModule)}, 19 | { path:'saving',component:SavingAccComponent}, 20 | { path:'current',component:CurrentAccComponent}, 21 | 22 | ]; 23 | 24 | @NgModule({ 25 | imports: [RouterModule.forRoot(routes)], 26 | exports: [RouterModule] 27 | }) 28 | export class AppRoutingModule { } 29 | -------------------------------------------------------------------------------- /fb-login-page-routing/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "fb-login-page-routing", 3 | "version": "0.0.0", 4 | "scripts": { 5 | "ng": "ng", 6 | "start": "ng serve", 7 | "build": "ng build", 8 | "watch": "ng build --watch --configuration development", 9 | "test": "ng test" 10 | }, 11 | "private": true, 12 | "dependencies": { 13 | "@angular/animations": "^15.2.0", 14 | "@angular/common": "^15.2.0", 15 | "@angular/compiler": "^15.2.0", 16 | "@angular/core": "^15.2.0", 17 | "@angular/forms": "^15.2.0", 18 | "@angular/platform-browser": "^15.2.0", 19 | "@angular/platform-browser-dynamic": "^15.2.0", 20 | "@angular/router": "^15.2.0", 21 | "rxjs": "~7.8.0", 22 | "tslib": "^2.3.0", 23 | "zone.js": "~0.12.0" 24 | }, 25 | "devDependencies": { 26 | "@angular-devkit/build-angular": "^15.2.0", 27 | "@angular/cli": "~15.2.0", 28 | "@angular/compiler-cli": "^15.2.0", 29 | "@types/jasmine": "~4.3.0", 30 | "jasmine-core": "~4.5.0", 31 | "karma": "~6.4.0", 32 | "karma-chrome-launcher": "~3.1.0", 33 | "karma-coverage": "~2.2.0", 34 | "karma-jasmine": "~5.1.0", 35 | "karma-jasmine-html-reporter": "~2.0.0", 36 | "typescript": "~4.9.4" 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /FoodOrder_App/Food_order/src/app/components/pages/login/login.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | 4 | 5 |
6 | 7 | 8 | 9 | 11 | 12 | 13 |
14 | 15 |
16 | 17 |
18 |
19 |
should not empty
20 |
21 |
22 |
23 | 24 |
25 |
26 |
27 |
-------------------------------------------------------------------------------- /firstapp/src/app/app.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed } from '@angular/core/testing'; 2 | import { RouterTestingModule } from '@angular/router/testing'; 3 | import { AppComponent } from './app.component'; 4 | 5 | describe('AppComponent', () => { 6 | beforeEach(async () => { 7 | await TestBed.configureTestingModule({ 8 | imports: [ 9 | RouterTestingModule 10 | ], 11 | declarations: [ 12 | AppComponent 13 | ], 14 | }).compileComponents(); 15 | }); 16 | 17 | it('should create the app', () => { 18 | const fixture = TestBed.createComponent(AppComponent); 19 | const app = fixture.componentInstance; 20 | expect(app).toBeTruthy(); 21 | }); 22 | 23 | it(`should have as title 'firstapp'`, () => { 24 | const fixture = TestBed.createComponent(AppComponent); 25 | const app = fixture.componentInstance; 26 | expect(app.title).toEqual('firstapp'); 27 | }); 28 | 29 | it('should render title', () => { 30 | const fixture = TestBed.createComponent(AppComponent); 31 | fixture.detectChanges(); 32 | const compiled = fixture.nativeElement as HTMLElement; 33 | expect(compiled.querySelector('.content span')?.textContent).toContain('firstapp app is running!'); 34 | }); 35 | }); 36 | -------------------------------------------------------------------------------- /03 notes/ngClass.txt: -------------------------------------------------------------------------------- 1 | ngClass directive allows us to set the CSS Dynamically for a DOM element. 2 | ngClass with string 3 | ngClass with array 4 | ngClass with object 5 | ngClass with component method 6 | 7 | 8 | app.component.css 9 | .one{ 10 | color:blue; 11 | } 12 | .two{ 13 | font-size:30px; 14 | } 15 | .three{ 16 | color:green; 17 | } 18 | .four 19 | { 20 | font-weight:bold; 21 | } 22 | 23 | app.component.html 24 |

ngClass as a string

25 |

using ngclass with string example

26 | 27 |
28 | {{user}} 29 |
30 | 31 |

Example using ng class as object

32 | 33 |
34 | example using ngclass with component method 35 |
{ 6 | beforeEach(async () => { 7 | await TestBed.configureTestingModule({ 8 | imports: [ 9 | RouterTestingModule 10 | ], 11 | declarations: [ 12 | AppComponent 13 | ], 14 | }).compileComponents(); 15 | }); 16 | 17 | it('should create the app', () => { 18 | const fixture = TestBed.createComponent(AppComponent); 19 | const app = fixture.componentInstance; 20 | expect(app).toBeTruthy(); 21 | }); 22 | 23 | it(`should have as title 'Food_order'`, () => { 24 | const fixture = TestBed.createComponent(AppComponent); 25 | const app = fixture.componentInstance; 26 | expect(app.title).toEqual('Food_order'); 27 | }); 28 | 29 | it('should render title', () => { 30 | const fixture = TestBed.createComponent(AppComponent); 31 | fixture.detectChanges(); 32 | const compiled = fixture.nativeElement as HTMLElement; 33 | expect(compiled.querySelector('.content span')?.textContent).toContain('Food_order app is running!'); 34 | }); 35 | }); 36 | -------------------------------------------------------------------------------- /todoList/src/app/app.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed } from '@angular/core/testing'; 2 | import { RouterTestingModule } from '@angular/router/testing'; 3 | import { AppComponent } from './app.component'; 4 | 5 | describe('AppComponent', () => { 6 | beforeEach(async () => { 7 | await TestBed.configureTestingModule({ 8 | imports: [ 9 | RouterTestingModule 10 | ], 11 | declarations: [ 12 | AppComponent 13 | ], 14 | }).compileComponents(); 15 | }); 16 | 17 | it('should create the app', () => { 18 | const fixture = TestBed.createComponent(AppComponent); 19 | const app = fixture.componentInstance; 20 | expect(app).toBeTruthy(); 21 | }); 22 | 23 | it(`should have as title 'boot-ng-material'`, () => { 24 | const fixture = TestBed.createComponent(AppComponent); 25 | const app = fixture.componentInstance; 26 | expect(app.title).toEqual('boot-ng-material'); 27 | }); 28 | 29 | it('should render title', () => { 30 | const fixture = TestBed.createComponent(AppComponent); 31 | fixture.detectChanges(); 32 | const compiled = fixture.nativeElement as HTMLElement; 33 | expect(compiled.querySelector('.content span')?.textContent).toContain('boot-ng-material app is running!'); 34 | }); 35 | }); 36 | -------------------------------------------------------------------------------- /01 JavaScript/ArrayCRUD.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Document 8 | 9 | 10 | 46 | 47 | -------------------------------------------------------------------------------- /FoodOrder_App/Food_order/src/app/components/partial/validations/validations.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, Input, OnChanges, OnInit, SimpleChanges } from '@angular/core'; 2 | import { AbstractControl } from '@angular/forms'; 3 | 4 | const VALIDATORS_MESSAGES:any={ 5 | required:'should not be empty', 6 | email:'Email is not valid' 7 | } 8 | @Component({ 9 | selector: 'app-validations', 10 | templateUrl: './validations.component.html', 11 | styleUrls: ['./validations.component.css'] 12 | }) 13 | export class ValidationsComponent implements OnInit, OnChanges { 14 | @Input() 15 | control!:AbstractControl 16 | @Input() 17 | showErrorsWhen:boolean=true; 18 | errorMessages:string[]=[]; 19 | constructor() { } 20 | ngOnChanges(changes: SimpleChanges): void { 21 | this.checkValidation() 22 | } 23 | ngOnInit(): void { 24 | this.control.statusChanges.subscribe(()=>{ 25 | this.checkValidation() 26 | }); 27 | this.control.valueChanges.subscribe(()=>{ 28 | this.checkValidation() 29 | }) 30 | } 31 | checkValidation(){ 32 | const errors=this.control.errors; 33 | if(!errors){ 34 | this.errorMessages=[]; 35 | return 36 | } 37 | const errorKeys=Object.keys(errors); 38 | this.errorMessages=errorKeys.map(key=>VALIDATORS_MESSAGES[key]) 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /Crud-using-Services/src/app/app.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed } from '@angular/core/testing'; 2 | import { RouterTestingModule } from '@angular/router/testing'; 3 | import { AppComponent } from './app.component'; 4 | 5 | describe('AppComponent', () => { 6 | beforeEach(async () => { 7 | await TestBed.configureTestingModule({ 8 | imports: [ 9 | RouterTestingModule 10 | ], 11 | declarations: [ 12 | AppComponent 13 | ], 14 | }).compileComponents(); 15 | }); 16 | 17 | it('should create the app', () => { 18 | const fixture = TestBed.createComponent(AppComponent); 19 | const app = fixture.componentInstance; 20 | expect(app).toBeTruthy(); 21 | }); 22 | 23 | it(`should have as title 'Crud-using-Services'`, () => { 24 | const fixture = TestBed.createComponent(AppComponent); 25 | const app = fixture.componentInstance; 26 | expect(app.title).toEqual('Crud-using-Services'); 27 | }); 28 | 29 | it('should render title', () => { 30 | const fixture = TestBed.createComponent(AppComponent); 31 | fixture.detectChanges(); 32 | const compiled = fixture.nativeElement as HTMLElement; 33 | expect(compiled.querySelector('.content span')?.textContent).toContain('Crud-using-Services app is running!'); 34 | }); 35 | }); 36 | -------------------------------------------------------------------------------- /fb-login-page-routing/src/app/app.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed } from '@angular/core/testing'; 2 | import { RouterTestingModule } from '@angular/router/testing'; 3 | import { AppComponent } from './app.component'; 4 | 5 | describe('AppComponent', () => { 6 | beforeEach(async () => { 7 | await TestBed.configureTestingModule({ 8 | imports: [ 9 | RouterTestingModule 10 | ], 11 | declarations: [ 12 | AppComponent 13 | ], 14 | }).compileComponents(); 15 | }); 16 | 17 | it('should create the app', () => { 18 | const fixture = TestBed.createComponent(AppComponent); 19 | const app = fixture.componentInstance; 20 | expect(app).toBeTruthy(); 21 | }); 22 | 23 | it(`should have as title 'fb-login-page-routing'`, () => { 24 | const fixture = TestBed.createComponent(AppComponent); 25 | const app = fixture.componentInstance; 26 | expect(app.title).toEqual('fb-login-page-routing'); 27 | }); 28 | 29 | it('should render title', () => { 30 | const fixture = TestBed.createComponent(AppComponent); 31 | fixture.detectChanges(); 32 | const compiled = fixture.nativeElement as HTMLElement; 33 | expect(compiled.querySelector('.content span')?.textContent).toContain('fb-login-page-routing app is running!'); 34 | }); 35 | }); 36 | -------------------------------------------------------------------------------- /firstapp/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "firstapp", 3 | "version": "0.0.0", 4 | "scripts": { 5 | "ng": "ng", 6 | "start": "ng serve", 7 | "build": "ng build", 8 | "watch": "ng build --watch --configuration development", 9 | "test": "ng test" 10 | }, 11 | "private": true, 12 | "dependencies": { 13 | "@angular/animations": "^15.2.0", 14 | "@angular/common": "^15.2.0", 15 | "@angular/compiler": "^15.2.0", 16 | "@angular/core": "^15.2.0", 17 | "@angular/forms": "^15.2.0", 18 | "@angular/platform-browser": "^15.2.0", 19 | "@angular/platform-browser-dynamic": "^15.2.0", 20 | "@angular/router": "^15.2.0", 21 | "bootstrap": "^5.1.3", 22 | "jquery": "^3.6.4", 23 | "rxjs": "~7.8.0", 24 | "tslib": "^2.3.0", 25 | "zone.js": "~0.12.0" 26 | }, 27 | "devDependencies": { 28 | "@angular-devkit/build-angular": "^15.2.0", 29 | "@angular/cli": "~15.2.0", 30 | "@angular/compiler-cli": "^15.2.0", 31 | "@types/jasmine": "~4.3.0", 32 | "@types/jquery": "^3.5.16", 33 | "jasmine-core": "~4.5.0", 34 | "karma": "~6.4.0", 35 | "karma-chrome-launcher": "~3.1.0", 36 | "karma-coverage": "~2.2.0", 37 | "karma-jasmine": "~5.1.0", 38 | "karma-jasmine-html-reporter": "~2.0.0", 39 | "typescript": "~4.9.4" 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /FoodOrder_App/Food_order/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "food-order", 3 | "version": "0.0.0", 4 | "scripts": { 5 | "ng": "ng", 6 | "start": "ng serve", 7 | "build": "ng build", 8 | "watch": "ng build --watch --configuration development", 9 | "test": "ng test" 10 | }, 11 | "private": true, 12 | "dependencies": { 13 | "@angular/animations": "~13.1.0", 14 | "@angular/common": "~13.1.0", 15 | "@angular/compiler": "~13.1.0", 16 | "@angular/core": "~13.1.0", 17 | "@angular/forms": "~13.1.0", 18 | "@angular/platform-browser": "~13.1.0", 19 | "@angular/platform-browser-dynamic": "~13.1.0", 20 | "@angular/router": "~13.1.0", 21 | "ng-starrating": "^1.0.20", 22 | "ngx-toastr": "^13.2.1", 23 | "rxjs": "~7.4.0", 24 | "tslib": "^2.3.0", 25 | "zone.js": "~0.11.4" 26 | }, 27 | "devDependencies": { 28 | "@angular-devkit/build-angular": "~13.1.3", 29 | "@angular/cli": "~13.1.3", 30 | "@angular/compiler-cli": "~13.1.0", 31 | "@types/jasmine": "~3.10.0", 32 | "@types/node": "^12.11.1", 33 | "jasmine-core": "~3.10.0", 34 | "karma": "~6.3.0", 35 | "karma-chrome-launcher": "~3.1.0", 36 | "karma-coverage": "~2.1.0", 37 | "karma-jasmine": "~4.0.0", 38 | "karma-jasmine-html-reporter": "~1.7.0", 39 | "typescript": "~4.5.2" 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /Crud-using-Services/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "crud-using-services", 3 | "version": "0.0.0", 4 | "scripts": { 5 | "ng": "ng", 6 | "start": "ng serve", 7 | "build": "ng build", 8 | "watch": "ng build --watch --configuration development", 9 | "test": "ng test" 10 | }, 11 | "private": true, 12 | "dependencies": { 13 | "@angular/animations": "^15.2.0", 14 | "@angular/cdk": "^15.2.8", 15 | "@angular/common": "^15.2.0", 16 | "@angular/compiler": "^15.2.0", 17 | "@angular/core": "^15.2.0", 18 | "@angular/forms": "^15.2.0", 19 | "@angular/material": "^15.2.8", 20 | "@angular/platform-browser": "^15.2.0", 21 | "@angular/platform-browser-dynamic": "^15.2.0", 22 | "@angular/router": "^15.2.0", 23 | "json-server": "^0.17.3", 24 | "rxjs": "~7.8.0", 25 | "tslib": "^2.3.0", 26 | "zone.js": "~0.12.0" 27 | }, 28 | "devDependencies": { 29 | "@angular-devkit/build-angular": "^15.2.0", 30 | "@angular/cli": "~15.2.0", 31 | "@angular/compiler-cli": "^15.2.0", 32 | "@types/jasmine": "~4.3.0", 33 | "jasmine-core": "~4.5.0", 34 | "karma": "~6.4.0", 35 | "karma-chrome-launcher": "~3.1.0", 36 | "karma-coverage": "~2.2.0", 37 | "karma-jasmine": "~5.1.0", 38 | "karma-jasmine-html-reporter": "~2.0.0", 39 | "typescript": "~4.9.4" 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /01 JavaScript/object.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Document 8 | 9 | 10 |

Object in JS

11 |
12 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /todoList/src/app/app.module.ts: -------------------------------------------------------------------------------- 1 | import { ReactiveFormsModule, FormsModule } from '@angular/forms'; 2 | import { NgModule } from '@angular/core'; 3 | import { BrowserModule } from '@angular/platform-browser'; 4 | 5 | import { AppRoutingModule } from 'src/app/app-routing.module'; 6 | import { AppComponent } from 'src/app/app.component'; 7 | import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; 8 | import { ToDoListComponent } from 'src/app/todo-list/todo-list.component'; 9 | 10 | import { MatButtonModule } from '@angular/material/button'; 11 | import { MatCardModule } from '@angular/material/card'; 12 | import { MatInputModule } from '@angular/material/input'; 13 | import { MatFormFieldModule } from '@angular/material/form-field'; 14 | import {DragDropModule} from '@angular/cdk/drag-drop' 15 | import { MatIconModule } from '@angular/material/icon'; 16 | 17 | 18 | @NgModule({ 19 | declarations: [ 20 | AppComponent, 21 | ToDoListComponent 22 | ], 23 | imports: [ 24 | BrowserModule, 25 | AppRoutingModule, 26 | BrowserAnimationsModule, 27 | MatButtonModule, 28 | MatFormFieldModule, 29 | FormsModule, 30 | ReactiveFormsModule, 31 | MatCardModule, 32 | MatInputModule, 33 | DragDropModule, 34 | MatIconModule 35 | ], 36 | providers: [], 37 | bootstrap: [AppComponent] 38 | }) 39 | export class AppModule { } 40 | -------------------------------------------------------------------------------- /FoodOrder_App/Food_order/src/app/components/pages/home/home.component.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 52 | -------------------------------------------------------------------------------- /fb-login-page-routing/src/app/profile/profile.component.css: -------------------------------------------------------------------------------- 1 | * { 2 | margin: 0; 3 | padding: 0 4 | } 5 | 6 | body { 7 | background-color: #000 8 | } 9 | 10 | .card { 11 | width: 350px; 12 | background-color: #efefef; 13 | border: none; 14 | cursor: pointer; 15 | transition: all 0.5s; 16 | } 17 | 18 | .image img { 19 | transition: all 0.5s 20 | } 21 | 22 | .card:hover .image img { 23 | transform: scale(1.5) 24 | } 25 | 26 | .btn { 27 | height: 140px; 28 | width: 140px; 29 | border-radius: 50% 30 | } 31 | 32 | .name { 33 | font-size: 22px; 34 | font-weight: bold 35 | } 36 | 37 | .idd { 38 | font-size: 14px; 39 | font-weight: 600 40 | } 41 | 42 | .idd1 { 43 | font-size: 12px 44 | } 45 | 46 | .number { 47 | font-size: 22px; 48 | font-weight: bold 49 | } 50 | 51 | .follow { 52 | font-size: 12px; 53 | font-weight: 500; 54 | color: #444444 55 | } 56 | 57 | .btn1 { 58 | height: 40px; 59 | width: 150px; 60 | border: none; 61 | background-color: #000; 62 | color: #aeaeae; 63 | font-size: 15px 64 | } 65 | 66 | .text span { 67 | font-size: 13px; 68 | color: #545454; 69 | font-weight: 500 70 | } 71 | 72 | .icons i { 73 | font-size: 19px 74 | } 75 | 76 | hr .new1 { 77 | border: 1px solid 78 | } 79 | 80 | .join { 81 | font-size: 14px; 82 | color: #a0a0a0; 83 | font-weight: bold 84 | } 85 | 86 | .date { 87 | background-color: #ccc 88 | } -------------------------------------------------------------------------------- /01 JavaScript/hoisting.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Document 8 | 9 | 10 |

Hoisting

11 |

12 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /FoodOrder_App/Food_order/src/app/components/pages/login/login.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import { FormBuilder, FormGroup, Validators } from '@angular/forms'; 3 | import { ActivatedRoute, Router } from '@angular/router'; 4 | import { UserService } from 'src/app/services/user.service'; 5 | 6 | @Component({ 7 | selector: 'app-login', 8 | templateUrl: './login.component.html', 9 | styleUrls: ['./login.component.css'] 10 | }) 11 | export class LoginComponent implements OnInit { 12 | loginForm!:FormGroup; 13 | isSubmitted=false; 14 | returnUrl=""; 15 | constructor(private formbuilder:FormBuilder, private userservice:UserService, 16 | private activatedRoute:ActivatedRoute, 17 | private router:Router) { } 18 | 19 | ngOnInit(): void { 20 | this.loginForm=this.formbuilder.group({ 21 | email:['',[Validators.required,Validators.email]], 22 | password:['',Validators.required] 23 | }) 24 | this.returnUrl=this.activatedRoute.snapshot.queryParams['returnUrl'] 25 | } 26 | get formControls(){ 27 | return this.loginForm.controls; 28 | } 29 | submit(){ 30 | 31 | this.isSubmitted=true; 32 | if(this.loginForm.invalid) 33 | return 34 | this.userservice.login({ 35 | email: this.formControls['email'].value, 36 | password: this.formControls['password'].value}).subscribe(()=>{ 37 | this.router.navigateByUrl(this.returnUrl) 38 | }) 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /01 JavaScript/function.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Calculator 8 | 9 | 10 |

Operation Functions

11 |
12 |

Calculator

13 | 48 |
49 | 50 | -------------------------------------------------------------------------------- /FoodOrder_App/Food_order/src/app/components/pages/food-page/food-page.component.html: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | 9 |
10 | 11 | 12 |
13 |
14 | 15 | {{food.name}} 16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 |
24 | 31 | 32 | 33 |
34 |
35 | {{origin}} 36 |
37 | 38 |
39 | {{tag}} 40 |
41 | 42 |
43 | 44 | Time to cook about {{food.cookTime}}minutes 45 | 46 |
47 | 48 | 49 |
50 | 51 | {{food.price |currency}} 52 | 53 |
54 | 55 | 56 |
57 | v
58 | -------------------------------------------------------------------------------- /todoList/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "todolist", 3 | "version": "0.0.0", 4 | "scripts": { 5 | "ng": "ng", 6 | "start": "ng serve", 7 | "build": "ng build", 8 | "watch": "ng build --watch --configuration development", 9 | "test": "ng test" 10 | }, 11 | "private": true, 12 | "dependencies": { 13 | "@angular/animations": "^15.2.0", 14 | "@angular/cdk": "^15.2.6", 15 | "@angular/common": "^15.2.0", 16 | "@angular/compiler": "^15.2.0", 17 | "@angular/core": "^15.2.0", 18 | "@angular/forms": "^15.2.0", 19 | "@angular/material": "^15.2.6", 20 | "@angular/platform-browser": "^15.2.0", 21 | "@angular/platform-browser-dynamic": "^15.2.0", 22 | "@angular/router": "^15.2.0", 23 | "@ng-bootstrap/ng-bootstrap": "^14.1.0", 24 | "rxjs": "~7.8.0", 25 | "tslib": "^2.3.0", 26 | "zone.js": "~0.12.0" 27 | }, 28 | "devDependencies": { 29 | "@angular-devkit/build-angular": "^15.2.0", 30 | "@angular/cli": "~15.2.0", 31 | "@angular/compiler-cli": "^15.2.0", 32 | "@types/jasmine": "~4.3.0", 33 | "jasmine-core": "~4.5.0", 34 | "karma": "~6.4.0", 35 | "karma-chrome-launcher": "~3.1.0", 36 | "karma-coverage": "~2.2.0", 37 | "karma-jasmine": "~5.1.0", 38 | "karma-jasmine-html-reporter": "~2.0.0", 39 | "typescript": "~4.9.4" 40 | }, 41 | "description": "This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 15.2.0.", 42 | "main": "index.js", 43 | "author": "", 44 | "license": "ISC" 45 | } 46 | -------------------------------------------------------------------------------- /fb-login-page-routing/src/app/profile/profile.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
6 | 9 | Arjun J 10 | @arjundhav 11 | 12 |
13 | 1000 14 |
15 |
16 | 17 | Arjun J is Web Developer from Nanded

18 | He is an Full Stack Enthusiatic 19 |
20 |
21 |
22 | 23 | 24 | 25 | 26 |
27 |
28 | Joined March,2023 29 |
30 | 31 |
32 | Logout 33 |
34 |
35 |
36 |
37 | -------------------------------------------------------------------------------- /FoodOrder_App/Food_order/src/app/components/pages/cart-page/cart-page.component.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 9 |
10 |
    11 |
  • 12 |
    13 | 14 |
    15 | 21 |
    22 | 31 |
    32 |
    33 | {{cartItem.price |currency}} 34 |
    35 | 36 |
    37 | 38 |
    39 |
  • 40 |
41 |
42 |
43 |
{{cart.totalCount}}
44 |
{{cart.totalPrice|currency}}
45 | 46 |
47 | Proceed to checkout 48 |
49 |
50 | -------------------------------------------------------------------------------- /FoodOrder_App/Food_order/src/app/components/pages/home/home.component.css: -------------------------------------------------------------------------------- 1 | ul{ 2 | list-style: none; 3 | display: flex; 4 | justify-content: center; 5 | align-items: center; 6 | flex-wrap: wrap; 7 | padding: 0; 8 | } 9 | li a{ 10 | height: 22.5rem; 11 | width:20rem; 12 | border: 1px solid whitesmoke; 13 | border-radius: 1rem; 14 | margin: 0.5rem; 15 | display: flex; 16 | flex-direction: column; 17 | overflow: hidden; 18 | color: #e72929; 19 | } 20 | li a:hover{ 21 | cursor: pointer; 22 | opacity: 0.9; 23 | 24 | } 25 | li a img{ 26 | object-fit: cover; 27 | height: 14.5rem; 28 | } 29 | .content{ 30 | margin-top:0.3rem; 31 | padding: 0.5rem 1rem; 32 | position: relative; 33 | height: 8rem; 34 | } 35 | .favorite{ 36 | font-size: 1.4rem; 37 | position: absolute; 38 | top:0.5rem; 39 | right:1rem 40 | } 41 | .favorite.not{ 42 | color: grey; 43 | } 44 | .stars{ 45 | margin-bottom: 0.2rem; 46 | } 47 | .product-item-footer{ 48 | display: flex; 49 | justify-content: space-between; 50 | } 51 | .origins{ 52 | flex: 9; 53 | 54 | } 55 | .origins span{ 56 | border-radius: 2rem; 57 | background-color: whitesmoke; 58 | display: inline-block; 59 | padding: 0 0.5rem; 60 | font-size: 0.8rem; 61 | color: grey; 62 | margin-right: 0.3rem; 63 | margin-top: 0.3rem; 64 | } 65 | .cook-time{ 66 | font-size: 0.9rem; 67 | flex: 3; 68 | text-align: right; 69 | } 70 | .price{ 71 | position: absolute; 72 | bottom: 0; 73 | left: 0.9rem; 74 | background: white; 75 | padding: 0.3rem 100% 0 0; 76 | color:rgb(157, 157, 157); 77 | margin-top: 0.7rem; 78 | font-size: 1.1rem; 79 | } 80 | -------------------------------------------------------------------------------- /FoodOrder_App/Food_order/karma.conf.js: -------------------------------------------------------------------------------- 1 | // Karma configuration file, see link for more information 2 | // https://karma-runner.github.io/1.0/config/configuration-file.html 3 | 4 | module.exports = function (config) { 5 | config.set({ 6 | basePath: '', 7 | frameworks: ['jasmine', '@angular-devkit/build-angular'], 8 | plugins: [ 9 | require('karma-jasmine'), 10 | require('karma-chrome-launcher'), 11 | require('karma-jasmine-html-reporter'), 12 | require('karma-coverage'), 13 | require('@angular-devkit/build-angular/plugins/karma') 14 | ], 15 | client: { 16 | jasmine: { 17 | // you can add configuration options for Jasmine here 18 | // the possible options are listed at https://jasmine.github.io/api/edge/Configuration.html 19 | // for example, you can disable the random execution with `random: false` 20 | // or set a specific seed with `seed: 4321` 21 | }, 22 | clearContext: false // leave Jasmine Spec Runner output visible in browser 23 | }, 24 | jasmineHtmlReporter: { 25 | suppressAll: true // removes the duplicated traces 26 | }, 27 | coverageReporter: { 28 | dir: require('path').join(__dirname, './coverage/food-order'), 29 | subdir: '.', 30 | reporters: [ 31 | { type: 'html' }, 32 | { type: 'text-summary' } 33 | ] 34 | }, 35 | reporters: ['progress', 'kjhtml'], 36 | port: 9876, 37 | colors: true, 38 | logLevel: config.LOG_INFO, 39 | autoWatch: true, 40 | browsers: ['Chrome'], 41 | singleRun: false, 42 | restartOnFileChange: true 43 | }); 44 | }; 45 | -------------------------------------------------------------------------------- /01 JavaScript/mathMethod.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Document 8 | 9 | 10 | 53 | 54 | -------------------------------------------------------------------------------- /firstapp/src/app/app.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { BrowserModule } from '@angular/platform-browser'; 3 | 4 | import { AppRoutingModule } from './app-routing.module'; 5 | import { AppComponent } from './app.component'; 6 | import { NavComponent } from './nav/nav.component'; 7 | import { AboutComponent } from './about/about.component'; 8 | import { ContactComponent } from './contact/contact.component'; 9 | import { HomeComponent } from './home/home.component'; 10 | import { FormsModule, ReactiveFormsModule } from '@angular/forms'; 11 | import { BeveragesComponent } from './beverages/beverages.component'; 12 | import { ChildLifecycleHooksComponent } from './child-lifecycle-hooks/child-lifecycle-hooks.component'; 13 | import { ParentLifecycleHooksComponent } from './parent-lifecycle-hooks/parent-lifecycle-hooks.component'; 14 | import { DemoDirectiveDirective } from './demo-directive.directive'; 15 | import { ViewChildComponent } from './view-child/view-child.component'; 16 | import { CounterComponent } from './counter/counter.component'; 17 | 18 | @NgModule({ 19 | //All component declarations 20 | declarations: [ 21 | AppComponent, 22 | NavComponent, 23 | AboutComponent, 24 | ContactComponent, 25 | HomeComponent, 26 | BeveragesComponent, 27 | ChildLifecycleHooksComponent, 28 | ParentLifecycleHooksComponent, 29 | DemoDirectiveDirective, 30 | ViewChildComponent, 31 | CounterComponent 32 | ], 33 | imports: [ 34 | BrowserModule, 35 | AppRoutingModule, 36 | // UserModule, 37 | FormsModule, 38 | ReactiveFormsModule 39 | ], 40 | providers: [], //services 41 | bootstrap: [AppComponent] 42 | }) 43 | export class AppModule { } 44 | -------------------------------------------------------------------------------- /todoList/src/app/todo-list/todo-list.component.css: -------------------------------------------------------------------------------- 1 | mat-form-field 2 | { 3 | width: 100%; 4 | } 5 | section { 6 | display: table; 7 | } 8 | 9 | .example-label { 10 | display: table-cell; 11 | font-size: 14px; 12 | margin-left: 8px; 13 | min-width: 120px; 14 | } 15 | 16 | .example-button-row { 17 | display: table-cell; 18 | width: 490px; 19 | } 20 | 21 | .example-button-row .mat-button-base { 22 | margin: 8px 8px 8px 0; 23 | } 24 | 25 | .example-container { 26 | width: 400px; 27 | max-width: 100%; 28 | margin: 0 25px 25px 0; 29 | display: inline-block; 30 | vertical-align: top; 31 | } 32 | 33 | .example-list { 34 | border: solid 1px #ccc; 35 | min-height: 60px; 36 | background: rgb(253, 253, 253); 37 | border-radius: 4px; 38 | overflow: hidden; 39 | display: block; 40 | } 41 | 42 | .example-box { 43 | padding: 20px 10px; 44 | border-bottom: solid 1px #ccc; 45 | color: rgba(0, 0, 0, 0.87); 46 | display: flex; 47 | flex-direction: row; 48 | align-items: center; 49 | justify-content: space-between; 50 | box-sizing: border-box; 51 | cursor: move; 52 | background: rgb(206, 206, 206); 53 | font-size: 14px; 54 | } 55 | 56 | .cdk-drag-preview { 57 | box-sizing: border-box; 58 | border-radius: 4px; 59 | box-shadow: 0 5px 5px -3px rgba(0, 0, 0, 0.2), 60 | 0 8px 10px 1px rgba(0, 0, 0, 0.14), 61 | 0 3px 14px 2px rgba(0, 0, 0, 0.12); 62 | } 63 | 64 | .cdk-drag-placeholder { 65 | opacity: 0; 66 | } 67 | 68 | .cdk-drag-animating { 69 | transition: transform 250ms cubic-bezier(0, 0, 0.2, 1); 70 | } 71 | 72 | .example-box:last-child { 73 | border: none; 74 | } 75 | 76 | .example-list.cdk-drop-list-dragging .example-box:not(.cdk-drag-placeholder) { 77 | transition: transform 250ms cubic-bezier(0, 0, 0.2, 1); 78 | } 79 | -------------------------------------------------------------------------------- /FoodOrder_App/Food_order/src/app/services/user.service.ts: -------------------------------------------------------------------------------- 1 | import { HttpClient } from '@angular/common/http'; 2 | import { Injectable } from '@angular/core'; 3 | import { BehaviorSubject, Observable, tap } from 'rxjs'; 4 | import { IUserLogin } from 'src/interfaces/IUserLogin'; 5 | import {User} from 'user' 6 | import { USER_LOGIN_URL } from '../constants/urls'; 7 | import { ToastrService } from 'ngx-toastr'; 8 | 9 | const USER_KEY='User'; 10 | @Injectable({ 11 | providedIn: 'root' 12 | }) 13 | export class UserService { 14 | private userSubject=new BehaviorSubject(this.getUserFromLocalstorage()); 15 | public userObservable!:Observable 16 | constructor(private http: HttpClient ,private toastrService:ToastrService) { 17 | this.userObservable=this.userSubject.asObservable() 18 | } 19 | login(userLogin:IUserLogin):Observable{ 20 | return this.http.post(USER_LOGIN_URL, userLogin).pipe(tap({ 21 | next:(user)=>{ 22 | this.setUserToLocalStorage(user) 23 | this.userSubject.next(user) 24 | this.toastrService.success( 25 | `Welcome to Food_Order ${user.name}!`, 26 | 'Login successful' 27 | ) 28 | }, 29 | error:(errorResponse)=>{ 30 | this.toastrService.error(errorResponse.error,'Login Failed') 31 | } 32 | })) 33 | } 34 | private setUserToLocalStorage(user:User){ 35 | localStorage.setItem(USER_KEY,JSON.stringify(user)) 36 | } 37 | logOut(){ 38 | this.userSubject.next(new User()); 39 | localStorage.removeItem(USER_KEY); 40 | window.location.reload() 41 | } 42 | 43 | private getUserFromLocalstorage():User{ 44 | const userJson=localStorage.getItem(USER_KEY); 45 | if(userJson) 46 | return JSON.parse(userJson)as User; 47 | return new User(); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /Crud-using-Services/src/app/app.module.ts: -------------------------------------------------------------------------------- 1 | import { MatInputModule } from '@angular/material/input'; 2 | import { NgModule } from '@angular/core'; 3 | import { BrowserModule } from '@angular/platform-browser'; 4 | 5 | import { AppRoutingModule } from './app-routing.module'; 6 | import { AppComponent } from './app.component'; 7 | import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; 8 | 9 | import {MatDialogModule} from '@angular/material/dialog'; 10 | import {MatToolbarModule} from '@angular/material/toolbar'; 11 | import { MatButtonModule } from '@angular/material/button'; 12 | import { MatIconModule } from '@angular/material/icon'; 13 | import { DialogComponent } from './dialog/dialog.component'; 14 | import { MatFormFieldModule } from '@angular/material/form-field'; 15 | import { FormsModule, ReactiveFormsModule } from '@angular/forms'; 16 | import {MatSelectModule} from '@angular/material/select'; 17 | import {MatRadioModule} from '@angular/material/radio'; 18 | import {MatDatepickerModule} from '@angular/material/datepicker'; 19 | import { MatNativeDateModule } from '@angular/material/core'; 20 | import { HttpClientModule } from '@angular/common/http'; 21 | import {MatTableModule} from '@angular/material/table'; 22 | import {MatPaginatorModule} from '@angular/material/paginator'; 23 | 24 | @NgModule({ 25 | declarations: [ 26 | AppComponent, 27 | DialogComponent 28 | ], 29 | imports: [ 30 | BrowserModule, 31 | AppRoutingModule, 32 | BrowserAnimationsModule, 33 | MatDialogModule, 34 | MatToolbarModule, 35 | MatIconModule, 36 | MatButtonModule, 37 | MatFormFieldModule, 38 | FormsModule, 39 | ReactiveFormsModule, 40 | MatInputModule, 41 | MatSelectModule, 42 | MatRadioModule, 43 | MatDatepickerModule, 44 | MatNativeDateModule, 45 | HttpClientModule, 46 | MatTableModule, 47 | MatPaginatorModule 48 | ], 49 | providers: [], 50 | bootstrap: [AppComponent] 51 | }) 52 | export class AppModule { } 53 | -------------------------------------------------------------------------------- /01 JavaScript/loops.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Document 8 | 9 | 10 |

Loops

11 |
12 |

For Loop

13 | 18 | 19 |

For each Loop

20 | 26 | 27 |

While Loop

28 | 35 | 36 |

Do While Loop

37 | 44 | 45 |

While llop with break

46 | 56 | 57 |

For In Loop

58 | 64 | 65 |

For Of Loop

66 | 72 |
73 | 74 | -------------------------------------------------------------------------------- /03 notes/ng-switch.txt: -------------------------------------------------------------------------------- 1 | ngSwitch 2 | ngSwitch is actually comprised of two directives, an attribute directive and a structural 3 | directive. It's very similar to a switch statement in javascript and other programming lanuages,but in the tempalte. 4 | 5 | The ng-switch directive lets you hide/show HTML elements depending on an expression. 6 | 7 | We can also define a deafault section, by using the ng-switch-default directive, to show a section if none of the other 8 | sections get a match. 9 | 10 | Three things to keep in mind -NgSwitch, ngSwitchCase, ngSwitchDefault. 11 | 12 | app.component.html 13 |

using switch

14 | 22 |
23 |

First

24 |

Second

25 |

Third

26 |

Default

27 |
28 | 29 | 30 | App.component.ts 31 | export class Appcomponent{ 32 | public choose=''; 33 | setvalue(drp:any){ 34 | this.choose=drp.target.value; 35 | } 36 | 37 | ************************************************** 38 | Acess Modifier in Typescript: 39 | public-It is default. no need to mention it. 40 | private -If is used in function only. 41 | protected-same as like private 42 | 43 | class Students{ 44 | private firstname:string; 45 | private lastname:string; 46 | private age:number; 47 | 48 | 49 | constructor( private firstname:string, private age:number, private lastname?:string){ 50 | this.firstname = firstname; 51 | this.lastname = lastname; 52 | this.age = age; 53 | } 54 | getFirstname(){ 55 | console.log("My firstname is" + this.firstname + " " + this.age); 56 | } 57 | getLastname(){ 58 | } 59 | } 60 | 61 | let stu = new Students("Vishank",10); 62 | stu.age =11; 63 | stud.getFirstname(); 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | -------------------------------------------------------------------------------- /FoodOrder_App/Food_order/src/app/services/cart.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | import { Cart } from 'Cart'; 3 | import { CartItem } from 'CartItems'; 4 | import { Food } from 'Food'; 5 | import { BehaviorSubject, Observable } from 'rxjs'; 6 | 7 | @Injectable({ 8 | providedIn: 'root' 9 | }) 10 | export class CartService { 11 | private cart = new Cart(); 12 | private cartSubject: BehaviorSubject = new BehaviorSubject(this.cart) 13 | constructor() { } 14 | 15 | addToCart(food: Food) { 16 | let cartItem = this.cart.items.find(item => item.food.id === food.id) 17 | if (cartItem) 18 | return 19 | this.cart.items.push(new CartItem(food)); 20 | 21 | this.setCartToLocalStorage(); 22 | 23 | } 24 | 25 | removeFromCart(foodId: string): void { 26 | this.cart.items = this.cart.items.filter(item => item.food.id != foodId); 27 | 28 | this.setCartToLocalStorage(); 29 | } 30 | 31 | changeQuantity(foodId: string, qauntity: number) { 32 | let cartItem = this.cart.items.find(item => item.food.id === foodId) 33 | 34 | if (!cartItem) 35 | return 36 | cartItem.quantity = qauntity; 37 | cartItem.price = qauntity * cartItem.food.price 38 | 39 | this.setCartToLocalStorage() 40 | 41 | } 42 | 43 | clearCart() { 44 | this.cart = new Cart(); 45 | this.setCartToLocalStorage(); 46 | } 47 | getCartObservable(): Observable { 48 | return this.cartSubject.asObservable() 49 | } 50 | 51 | private setCartToLocalStorage(): void { 52 | this.cart.totalPrice = this.cart.items.reduce((prevSum, currentItem) => prevSum + currentItem.price, 0); 53 | 54 | this.cart.totalCount = this.cart.items.reduce((prevSum, currentItem) => prevSum + currentItem.quantity, 0) 55 | 56 | const cartJson = JSON.stringify(this.cart); 57 | 58 | localStorage.setItem('Cart', cartJson); 59 | 60 | this.cartSubject.next(this.cart) 61 | } 62 | 63 | private getCartFromLocalStorage(): Cart { 64 | const cartJson = localStorage.getItem('Cart'); 65 | return cartJson ? JSON.parse(cartJson) : new Cart() 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /fb-login-page-routing/src/app/login/login.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | 5 | 6 | people 7 | 8 |
9 |
10 |
11 |
12 |

Facebook Login

13 |

Connect with friends and the world around you on Facebook.

14 |
15 | 16 |
17 | 18 | 19 |
20 | 21 |
22 | 23 | 24 |
25 | 26 |
27 | Login
28 |
29 |
30 | Fogotten Password 31 | SignUp 32 |
33 | 34 |
35 |
36 |
37 |
38 | 39 |
-------------------------------------------------------------------------------- /01 JavaScript/numberMethod.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Document 8 | 9 | 10 | 65 | 66 | -------------------------------------------------------------------------------- /FoodOrder_App/Food_order/src/app/components/pages/food-page/food-page.component.css: -------------------------------------------------------------------------------- 1 | .container{ 2 | display: flex; 3 | justify-content: center; 4 | align-items: center; 5 | flex-wrap: wrap; 6 | margin: 3rem; 7 | } 8 | 9 | .container>*{ 10 | min-width: 25rem; 11 | max-width: 40rem; 12 | } 13 | 14 | img{ 15 | border-radius: 3rem; 16 | flex: 1 0; 17 | object-fit: cover; 18 | height:35rem ; 19 | margin: 1rem; 20 | } 21 | .details{ 22 | width: 100%; 23 | display: flex; 24 | flex-direction: column; 25 | flex: 1 0; 26 | border: 3rem; 27 | padding: 2rem; 28 | color: black; 29 | margin-left: 1rem; 30 | } 31 | .header{ 32 | display: flex; 33 | justify-content: space-between; 34 | } 35 | .name{ 36 | font-size: 2rem; 37 | font-weight: bold; 38 | } 39 | 40 | .favorite{ 41 | color: #e72929; 42 | font-size: 2.5rem; 43 | 44 | } 45 | .favorite.not{ 46 | color: grey; 47 | } 48 | 49 | .origins 50 | { 51 | display: flex; 52 | flex-wrap: wrap; 53 | margin: 1rem 0; 54 | } 55 | .origins span{ 56 | padding: 0.5rem; 57 | font-size: 1.2rem; 58 | margin: 0.5rem 0.5rem 0.5rem 0; 59 | border-radius: 2rem; 60 | background-color: aliceblue; 61 | } 62 | .tags{ 63 | display: flex; 64 | flex-wrap: wrap; 65 | } 66 | .tags a{ 67 | background-color: white; 68 | padding: 0.3rem 1rem; 69 | margin: 0.2rem 0.15rem; 70 | border-radius: 10rem; 71 | font-weight: 600; 72 | color: blue; 73 | } 74 | 75 | .cook-time{ 76 | margin-top: 1rem; 77 | } 78 | .cook-time span{ 79 | padding: 0.6rem 2rem 0.6rem 0; 80 | border-radius: 10rem; 81 | font-size: 1.3rem; 82 | } 83 | .price{ 84 | font-size: 1.8rem; 85 | margin:2rem 2rem 2rem 0; 86 | color: green; 87 | } 88 | .price::before{ 89 | content: 'Price: '; 90 | color: darkgray; 91 | } 92 | button{ 93 | color: white; 94 | background-color: #e72929; 95 | border: none; 96 | font-size: 1.2rem; 97 | padding: 1rem; 98 | border-radius: 10rem; 99 | outline: none; 100 | } 101 | button:hover{ 102 | opacity: 0.9; 103 | cursor: pointer; 104 | } 105 | -------------------------------------------------------------------------------- /fb-login-page-routing/src/app/signup/signup.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | 5 | 6 | people 7 | 8 |
9 |
10 |
11 |
12 |

Facebook SignUp

13 |

Connect with friends and the world around you on Facebook.

14 | 15 |
16 |
17 | 18 | 19 |
20 | 21 |
22 | 23 | 24 |
25 | 26 |
27 | 28 | 29 |
30 |
31 |
32 | Register
33 |
34 |
35 | Already have account? LogIn 36 |
37 | 38 |
39 |
40 |
41 |
42 | 43 |
-------------------------------------------------------------------------------- /FoodOrder_App/Food_order/src/app/app.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { BrowserModule } from '@angular/platform-browser'; 3 | import {HttpClientModule} from '@angular/common/http' 4 | 5 | import { AppRoutingModule } from './app-routing.module'; 6 | import { AppComponent } from './app.component'; 7 | import { HeaderComponent } from './components/partial/header/header.component'; 8 | import { HomeComponent } from './components/pages/home/home.component'; 9 | import { RatingModule } from 'ng-starrating'; 10 | import { FoodPageComponent } from './components/pages/food-page/food-page.component'; 11 | import { CartPageComponent } from './components/pages/cart-page/cart-page.component'; 12 | import { TitleComponent } from './components/partial/title/title.component'; 13 | import { NotFoundComponent } from './components/partial/not-found/not-found.component'; 14 | import { SearchComponent } from './components/partial/search/search.component'; 15 | import { TagsComponent } from './components/partial/tags/tags.component'; 16 | import { LoginComponent } from './components/pages/login/login.component'; 17 | import { FormsModule, ReactiveFormsModule } from '@angular/forms'; 18 | import { ToastrModule } from 'ngx-toastr'; 19 | import {BrowserAnimationsModule} from '@angular/platform-browser/animations'; 20 | import { InputContainerComponent } from './components/partial/input-container/input-container.component'; 21 | import { ValidationsComponent } from './components/partial/validations/validations.component' 22 | @NgModule({ 23 | declarations: [ 24 | AppComponent, 25 | HeaderComponent, 26 | HomeComponent, 27 | FoodPageComponent, 28 | CartPageComponent, 29 | TitleComponent, 30 | NotFoundComponent, 31 | SearchComponent, 32 | TagsComponent, 33 | LoginComponent, 34 | InputContainerComponent, 35 | ValidationsComponent, 36 | 37 | ], 38 | imports: [ 39 | BrowserModule, 40 | BrowserAnimationsModule, 41 | AppRoutingModule, 42 | RatingModule, 43 | HttpClientModule, 44 | ReactiveFormsModule, FormsModule, 45 | ToastrModule.forRoot({ 46 | timeOut:3000, 47 | positionClass:'toast-bottom-right', 48 | newestOnTop:false 49 | }) 50 | 51 | 52 | ], 53 | providers: [], 54 | bootstrap: [AppComponent] 55 | }) 56 | export class AppModule { } 57 | -------------------------------------------------------------------------------- /todoList/src/app/todo-list/todo-list.component.ts: -------------------------------------------------------------------------------- 1 | import { CdkDragDrop, moveItemInArray, transferArrayItem } from '@angular/cdk/drag-drop'; 2 | import { Component, OnInit } from '@angular/core'; 3 | import { FormBuilder, FormGroup, Validators } from '@angular/forms'; 4 | import { ITask } from 'src/app/todo-list/task'; 5 | 6 | 7 | @Component({ 8 | selector: 'app-to-do-list', 9 | templateUrl: './todo-list.component.html', 10 | styleUrls: ['./todo-list.component.css'] 11 | }) 12 | 13 | export class ToDoListComponent implements OnInit { 14 | tasks:ITask[]=[]; 15 | signUP!:FormGroup 16 | updateID!: any; 17 | done: ITask[]=[]; 18 | isEditEnabled:boolean = false; 19 | action: string='Add'; 20 | Inprogress:ITask[]=[]; 21 | Done:ITask[]=[]; 22 | 23 | constructor(private fb:FormBuilder) { } 24 | 25 | ngOnInit(): void { 26 | this.signUP=this.fb.group({ 27 | task:['',Validators.required] 28 | } ) 29 | } 30 | 31 | addTask(){ 32 | console.log("Adding Task") 33 | this.tasks.push({ 34 | description:this.signUP.value.task, 35 | done:false 36 | }) 37 | } 38 | 39 | deleteTask(i:number){ 40 | console.log("Deleting") 41 | this.tasks.splice(i,1); 42 | } 43 | 44 | deleteTaskInprogress(i:number){ 45 | console.log("Deleting") 46 | this.Inprogress.splice(i,1); 47 | } 48 | 49 | deleteTaskDone(i:number){ 50 | console.log("Deleting") 51 | this.Done.splice(i,1); 52 | } 53 | 54 | editTask(item:ITask,i:number){ 55 | console.log("Editing") 56 | this.signUP.controls['task'].setValue(item.description); 57 | this.updateID=i; 58 | this.isEditEnabled=true; 59 | } 60 | 61 | updateTask(){ 62 | console.log("Updating") 63 | this.tasks[this.updateID].description=this.signUP.value.task; 64 | this.tasks[this.updateID].done=true; 65 | this.signUP.reset(); 66 | this.updateID= undefined; 67 | this.isEditEnabled=false; 68 | } 69 | 70 | 71 | drop(event: CdkDragDrop) { 72 | if (event.previousContainer === event.container) { 73 | moveItemInArray(event.container.data, event.previousIndex, event.currentIndex); 74 | } else { 75 | transferArrayItem( 76 | event.previousContainer.data, 77 | event.container.data, 78 | event.previousIndex, 79 | event.currentIndex, 80 | ); 81 | } 82 | } 83 | 84 | } -------------------------------------------------------------------------------- /FoodOrder_App/backend/src/server.ts: -------------------------------------------------------------------------------- 1 | import dotenv from 'dotenv' 2 | dotenv.config() 3 | import express from "express"; 4 | import cors from "cors"; 5 | import jwt from "jsonwebtoken" 6 | 7 | import { Sample_Food,sample_tags, sample_users } from "./data"; 8 | import foodRouter from './router/food.router' 9 | import userRouter from "./router/user.router"; 10 | import { dbConnect } from './configs/database.config'; 11 | 12 | dbConnect() 13 | 14 | const app = express(); 15 | 16 | app.use(express.json()) 17 | //localhost:4200; 18 | //localhost:5000 19 | app.use(cors()) 20 | app.use(cors({ 21 | credentials: true, 22 | origin: ["http://localhost:4200/"] 23 | })); 24 | 25 | app.use("/api/foods",foodRouter) 26 | 27 | app.use("/api/users",userRouter) 28 | 29 | app.get("/api/foods", (req, res) => { 30 | res.send(Sample_Food) 31 | }); 32 | 33 | app.get("/api/foods/search/:searchTerm", (req, res) => { 34 | const searchTerm = req.params.searchTerm; 35 | const foods = Sample_Food.filter(food => food.name.toLowerCase() 36 | .includes(searchTerm.toLowerCase())); 37 | res.send(foods) 38 | }); 39 | 40 | app.get("/api/foods/tags", (req, res) => { 41 | res.send(sample_tags) 42 | }); 43 | 44 | app.get("/api/foods/tag/:tagName", (req, res) => { 45 | const tagName = req.params.tagName; 46 | const foods = Sample_Food.filter(food => food.tags?.includes(tagName)); 47 | res.send(foods) 48 | }); 49 | 50 | app.get("/api/foods/:foodId", (req, res) => { 51 | const foodId = req.params.foodId; 52 | const food = Sample_Food.find(food => food.id == foodId); 53 | res.send(food) 54 | }) 55 | app.post("/api/users/login", (req, res) => { 56 | const { email, password } = req.body; 57 | const user = sample_users.find(user => user.email === email && 58 | user.password === password) 59 | 60 | if(user){ 61 | res.send(generateTokenResponse(user)) 62 | }else{ 63 | res.status(400).send("user name or password is not valid!") 64 | } 65 | 66 | }) 67 | const generateTokenResponse=(user:any)=>{ 68 | const token =jwt.sign({ 69 | email:user.email,isAdmin:user.isAdmin 70 | },"SomeRandomText",{ 71 | expiresIn:"30d" 72 | }) 73 | user.token=token 74 | return user 75 | } 76 | 77 | app.listen(5000,()=>{ 78 | console.log("Backend server is running https://localhost:5000/api/") 79 | }); 80 | -------------------------------------------------------------------------------- /FoodOrder_App/Food_order/src/app/components/pages/cart-page/cart-page.component.css: -------------------------------------------------------------------------------- 1 | .container{ 2 | display: flex; 3 | flex-wrap:wrap; 4 | align-items: flex-start; 5 | margin: 1.5rem; 6 | margin-top:0.7rem ; 7 | } 8 | ul{ 9 | display: flex; 10 | flex-direction: column; 11 | flex:3 0; 12 | justify-content: space-evenly; 13 | border: 1px solid lightgrey; 14 | border-radius: 1rem; 15 | list-style: none; 16 | margin: 0.5rem; 17 | padding: 0; 18 | } 19 | ul li{ 20 | display: flex; 21 | justify-content: space-around; 22 | align-items: center; 23 | flex-wrap: wrap; 24 | border-bottom: 1px solid lightgrey; 25 | } 26 | 27 | ul li:last-child{ 28 | border: none; 29 | } 30 | 31 | li img{ 32 | width: 5rem; 33 | height: 5rem; 34 | border-radius: 100rem; 35 | object-fit: cover; 36 | } 37 | 38 | li div{ 39 | padding: 1rem; 40 | } 41 | li div:not(:first-child){ 42 | flex-basis: 18%; 43 | } 44 | 45 | li select{ 46 | width: 3rem; 47 | outline: none; 48 | border: none; 49 | border-bottom: 1px solid lightgray; 50 | font-weight: 100; 51 | } 52 | 53 | li .remove-button{ 54 | border-radius: 1rem; 55 | border:none; 56 | padding: 0.5rem; 57 | color: red; 58 | opacity:0.7; 59 | outline: none; 60 | } 61 | 62 | li .remove-button:hover{ 63 | opacity: 1; 64 | cursor: pointer; 65 | } 66 | 67 | .checkout{ 68 | display: flex; 69 | flex-direction: column; 70 | justify-content: space-between; 71 | align-items: center; 72 | flex: 3; 73 | height: 15rem; 74 | border: 1px solid lightgray; 75 | border-radius: 1rem; 76 | padding: 0.5rem; 77 | margin: 0.5rem; 78 | } 79 | .checkout>div{ 80 | font-size: 1.4rem; 81 | margin: 1rem; 82 | flex: 3; 83 | flex-direction: column; 84 | justify-content: center; 85 | align-items: flex-start; 86 | } 87 | .foods-count{ 88 | margin-bottom: 1.5rem; 89 | } 90 | .foods-count::before{ 91 | content: 'Count: '; 92 | color: grey; 93 | } 94 | 95 | .total-price::before{ 96 | content: 'Price: '; 97 | color: grey; 98 | } 99 | .checkout a{ 100 | padding: 1rem; 101 | color: white; 102 | background-color: #e72929; 103 | display: block; 104 | width: 99%; 105 | border-radius: 1rem; 106 | text-align: center; 107 | opacity: 0.7; 108 | justify-content: center; 109 | } 110 | .checkout a:hover{ 111 | opacity: 1; 112 | cursor: pointer; 113 | } 114 | --------------------------------------------------------------------------------