# Activity 23: Research Angular Services

  
**What are Angular Services?**

* **Reusable Logic:** Services allow you to define functions and logic that can be shared across multiple components in your application. This avoids code duplication and promotes consistency.
    
* **Data Management:** They can manage and store data, acting as a central repository for information that needs to be accessed from different parts of your application.
    
* **Communication:** Services facilitate communication between components, allowing them to share data and events without direct dependencies.
    
* **Background Tasks:** They can handle tasks that run in the background, such as fetching data from an API or performing calculations.
    

**Key Benefits of Using Angular Services:**

* **Modularity:** Services break down your application into smaller, independent units, making it easier to understand, maintain, and test.
    
* **Testability:** Services can be easily tested in isolation, improving the overall quality of your code.
    
* **Maintainability:** By separating logic and data into services, you can make changes without impacting other parts of your application.
    
* **Reusability:** Services can be reused across multiple projects, saving you time and effort.
    

Sure, here is the numbered list:

1. Student List
    
    ```plaintext
    import { Component } from '@angular/core';
    import { Injectable } from '@angular/core';
    @Injectable({
      providedIn: 'root',
    })
    @Component({
      selector: 'app-studentlist',
      templateUrl: './studentlist.component.html',
      styleUrl: './studentlist.component.css'
    })
    export class StudentlistComponent {
      studentLis: string[] = ["gerlie", "dao-ayan"];
      item: string = '';
    
      addItems() {
        this.studentLis.push(this.item);
      }
    
      deleteStudent(index: number) {
        this.studentLis.splice(index, 1);
      }
    }
    ```
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1728628975602/b10d7aad-e892-4bd5-bb27-03bde7f3b886.png align="center")
    
2. Employee
    
    ```plaintext
    import {Component, Injectable} from '@angular/core';
    @Injectable({
      providedIn: 'root',
    })@Injectable({
      providedIn: 'root',
    })
    @Component({
      selector: 'app-employeelist',
      templateUrl: './employeelist.component.html',
      styleUrl: './employeelist.component.css'
    })
    export class EmployeelistComponent {
      employerList: string[] = ["employer1", "employer2"];
      item: string = '';
    
      addItems() {
        this.employerList.push(this.item);
      }
    
      deleteEmployee(index: number) {
        this.employerList.splice(index, 1);
      }
    }
    ```
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1728630277492/8453f6f3-1d22-4c5f-8114-1fc78df62837.png align="center")
    
3. Fruit List
    
    ```plaintext
    import {Component, Injectable} from '@angular/core';
    @Injectable({
      providedIn: 'root',
    })
    @Component({
      selector: 'app-fruit',
      templateUrl: './fruit.component.html',
      styleUrl: './fruit.component.css'
    })
    export class FruitComponent {
      fruitLis: string[] = ["grapes", "dragonfruit", "cherry"];
      item: string = '';
    
      addItems() {
        this.fruitLis.push(this.item);
      }
    
      deleteFruit(index: number) {
        this.fruitLis.splice(index, 1);
      }
    }
    ```
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1728630285300/a553bcb7-8938-40dc-8e97-8fda1579c697.png align="center")
    
4. Course List
    
    ```plaintext
    import {Component, Injectable} from '@angular/core';
    @Injectable({
      providedIn: 'root',
    })
    @Component({
      selector: 'app-course',
      templateUrl: './course.component.html',
      styleUrl: './course.component.css'
    })
    export class CourseComponent {
      courseLis: string[] = ["BSIT", "BSHM", "BSECUD"];
      item: string = '';
    
      addItems() {
        this.courseLis.push(this.item);
      }
    
      deleteCourse(index: number) {
        this.courseLis.splice(index, 1);
      }
    }
    ```
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1728630294337/72af7224-13d4-4f25-961a-c52fb8e3e151.png align="center")
    
5. Book List
    
    ```plaintext
    import {Component, Injectable} from '@angular/core';
    @Injectable({
      providedIn: 'root',
    })
    @Component({
      selector: 'app-book',
      templateUrl: './book.component.html',
      styleUrl: './book.component.css'
    })
    export class BookComponent {
      bookLit: string[] = ["c++", "java", "html"];
      item: string = '';
    
      addItems() {
        this.bookLit.push(this.item);
      }
    
      deleteBook(index: number) {
        this.bookLit.splice(index, 1);
      }
    }
    ```
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1728630400554/4de0ee15-1bcf-443e-a237-325f7deede4f.png align="center")
    
6. City List
    
    ```plaintext
    import {Component, Injectable} from '@angular/core';
    @Injectable({
      providedIn: 'root',
    })
    @Component({
      selector: 'app-city',
      templateUrl: './city.component.html',
      styleUrl: './city.component.css'
    })
    export class CityComponent {
      cityLis: string[] = ["spain", "america", "korea"];
      item: string = '';
    
      addItems() {
        this.cityLis.push(this.item);
      }
    
      deleteCity(index: number) {
        this.cityLis.splice(index, 1);
      }
    }
    ```
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1728630417130/5408f4de-cb2b-4244-9e29-5b7fad685d78.png align="center")
    
7. Movie List
    
    ```plaintext
    import {Component, Injectable} from '@angular/core';
    @Injectable({
      providedIn: 'root',
    })
    @Component({
      selector: 'app-movie',
      templateUrl: './movie.component.html',
      styleUrl: './movie.component.css'
    })
    export class MovieComponent {
      movieLis: string[] = ["shrek", "wrong turn"];
      item: string = '';
    
      addItems() {
        this.movieLis.push(this.item);
      }
    
      deleteMovie(index: number) {
        this.movieLis.splice(index, 1);
      }
    }
    ```
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1728630429853/aab92659-8f51-47d9-b6f7-d8f359d534a0.png align="center")
    
8. Car Model List
    
    ```plaintext
    import {Component, Injectable} from '@angular/core';
    @Injectable({
      providedIn: 'root',
    })
    @Component({
      selector: 'app-car',
      templateUrl: './car.component.html',
      styleUrl: './car.component.css'
    })
    export class CarComponent {
      carModelLis: string[] = ["Toyota", "Honda", "Mustang"];
      item: string = '';
    
      addItems() {
        this.carModelLis.push(this.item);
      }
    
      deleteCarModel(index: number) {
        this.carModelLis.splice(index, 1);
      }
    }
    ```
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1728630435907/20b514c3-9d5e-4041-bb50-a64354814a7b.png align="center")
    
9. Product List
    
    ```plaintext
    import {Component, Injectable} from '@angular/core';
    @Injectable({
      providedIn: 'root',
    })
    @Component({
      selector: 'app-product',
      templateUrl: './product.component.html',
      styleUrl: './product.component.css'
    })
    export class ProductComponent {
      productLis: string[] = ["phone", "tablet", "headset"];
      item: string = '';
    
      addItems() {
        this.productLis.push(this.item);
      }
    
      deleteProduct(index: number) {
        this.productLis.splice(index, 1);
      }
    }
    ```
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1728630447722/faa2f80b-0eab-49c0-895b-1edcf9a77bc8.png align="center")
    
10. Subject List
    
    ```plaintext
    import {Component, Injectable} from '@angular/core';
    @Injectable({
      providedIn: 'root',
    })
    @Component({
      selector: 'app-subject',
      templateUrl: './subject.component.html',
      styleUrl: './subject.component.css'
    })
    export class SubjectComponent {
      subjectLis: string[] = ["filifino", "English", "Science"];
      item: string = '';
    
      addItems() {
        this.subjectLis.push(this.item);
      }
    
      deleteSubject(index: number) {
        this.subjectLis.splice(index, 1);
      }
    }
    ```
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1728630453585/01431297-6c10-424b-99cd-b24a7671fb8f.png align="center")
    
11. Country List
    
    ```plaintext
    import {Component, Injectable} from '@angular/core';
    @Injectable({
      providedIn: 'root',
    })
    @Component({
      selector: 'app-country',
      templateUrl: './country.component.html',
      styleUrl: './country.component.css'
    })
    export class CountryComponent {
      countryLis: string[] = ["north korea", "Canada"];
      item: string = '';
    
      addItems() {
        this.countryLis.push(this.item);
      }
    
      deleteCountry(index: number) {
        this.countryLis.splice(index, 1);
      }
    }
    ```
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1728630463292/dd62382c-2d51-409a-8484-4b03c07d1a6c.png align="center")
    
12. Sports List
    
    ```plaintext
    import {Component, Injectable} from '@angular/core';
    @Injectable({
      providedIn: 'root',
    })
    @Component({
      selector: 'app-sport',
      templateUrl: './sport.component.html',
      styleUrl: './sport.component.css'
    })
    export class SportComponent {
      sportsLis: string[] = ["tennis", "Volleyball"];
      item: string = '';
    
      addItems() {
        this.sportsLis.push(this.item);
      }
    
      deleteSport(index: number) {
        this.sportsLis.splice(index, 1);
      }
    }
    ```
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1728630468709/d6e4791d-b09c-450c-826e-09dc1586a0e7.png align="center")
    
13. Vegetable List
    
    ```plaintext
    import {Component, Injectable} from '@angular/core';
    @Injectable({
      providedIn: 'root',
    })
    @Component({
      selector: 'app-vagetable',
      templateUrl: './vagetable.component.html',
      styleUrl: './vagetable.component.css'
    })
    export class VagetableComponent {
      vegetableLis: string[] = ["Carrot"];
      item: string = '';
    
      addItems() {
        this.vegetableLis.push(this.item);
      }
    
      deleteVegetable(index: number) {
        this.vegetableLis.splice(index, 1);
      }
    }
    ```
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1728630477497/685189c5-f458-41bb-b0f0-efe7005d60b9.png align="center")
    
14. Animal List
    
    ```plaintext
    import {Component, Injectable} from '@angular/core';
    @Injectable({
      providedIn: 'root',
    })
    @Component({
      selector: 'app-animal',
      templateUrl: './animal.component.html',
      styleUrl: './animal.component.css'
    })
    export class AnimalComponent {
      animalLis: string[] = ["Dog", "Cat"];
      item: string = '';
    
      addItems() {
        this.animalLis.push(this.item);
      }
    
      deleteAnimal(index: number) {
        this.animalLis.splice(index, 1);
      }
    }
    ```
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1728630489274/bc767a58-95a0-4513-b846-b5fc00cca963.png align="center")
    
15. Tool List
    
    ```plaintext
    import {Component, Injectable} from '@angular/core';
    @Injectable({
      providedIn: 'root',
    })
    @Component({
      selector: 'app-tool',
      templateUrl: './tool.component.html',
      styleUrl: './tool.component.css'
    })
    export class ToolComponent {
      toolLis: string[] = ["Hammer"];
      item: string = '';
    
      addItems() {
        this.toolLis.push(this.item);
      }
    
      deleteTool(index: number) {
        this.toolLis.splice(index, 1);
      }
    }
    ```
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1728630495133/8ec2e230-7a3f-4109-b5be-b277a31746c7.png align="center")
    
16. Language List
    
    ```plaintext
    import {Component, Injectable} from '@angular/core';
    @Injectable({
      providedIn: 'root',
    })
    @Component({
      selector: 'app-laguage',
      templateUrl: './laguage.component.html',
      styleUrl: './laguage.component.css'
    })
    export class LaguageComponent {
      languageLis: string[] = ["English"];
      item: string = '';
    
      addItems() {
        this.languageLis.push(this.item);
      }
    
      deleteLanguage(index: number) {
        this.languageLis.splice(index, 1);
      }
    }
    ```
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1728630504108/01c207e3-5789-4510-bd3b-3878b0458731.png align="center")
    
17. Game List
    
    ```plaintext
    import {Component, Injectable} from '@angular/core';
    @Injectable({
      providedIn: 'root',
    })
    @Component({
      selector: 'app-game',
      templateUrl: './game.component.html',
      styleUrl: './game.component.css'
    })
    export class GameComponent {
      gameLis: string[] = [ "Fortnite"];
      item: string = '';
    
      addItems() {
        this.gameLis.push(this.item);
      }
    
      deleteGame(index: number) {
        this.gameLis.splice(index, 1);
      }
    }
    ```
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1728630514135/e0ed8078-3bb8-470c-841e-cb9c66fb834a.png align="center")
    
18. Software List
    
    ```plaintext
    import {Component, Injectable} from '@angular/core';
    @Injectable({
      providedIn: 'root',
    })
    @Component({
      selector: 'app-software',
      templateUrl: './software.component.html',
      styleUrl: './software.component.css'
    })
    export class SoftwareComponent {
      software: string[] = [ "software1"];
      item: string = '';
    
      addItems() {
        this.software.push(this.item);
      }
    
      deleteGame(index: number) {
        this.software.splice(index, 1);
      }
    }
    ```
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1728630522664/e8eb180c-2a9d-4296-9e07-c75934411f57.png align="center")
    
19. Phone Contact List
    
    ```plaintext
    import {Component, Injectable} from '@angular/core';
    
    
    interface Contact {
      name: string;
      phoneNumber: string;
    
    }@Injectable({
      providedIn: 'root',
    })
    @Component({
      selector: 'app-phone',
      templateUrl: './phone.component.html',
      styleUrl: './phone.component.css'
    })
    export class PhoneComponent {
      contactLis: Contact[] = [
        { name: "Gerlie Dao-ayan", phoneNumber: "09518942333" },
        { name: "garl", phoneNumber: "09380798236" }
      ];
      name: string = '';
      phoneNumber: string = '';
    
      addContact() {
        const newContact: Contact = { name: this.name, phoneNumber: this.phoneNumber };
        this.contactLis.push(newContact);
        this.name = '';
        this.phoneNumber = '';
      }
    
      deleteContact(index: number) {
        this.contactLis.splice(index, 1);
      }
    }
    ```
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1728630556292/6d7af0db-ea49-4a6f-b6b2-c31028d9d231.png align="center")
    
20. Music Playlist
    
    ```plaintext
    import {Component, Injectable} from '@angular/core';
    @Injectable({
      providedIn: 'root',
    })
    @Component({
      selector: 'app-music',
      templateUrl: './music.component.html',
      styleUrl: './music.component.css'
    })
    export class MusicComponent {
      playlis: string[] = ["Bohemian Rhapsody", "Imagine", "Hotel California"];
      newSong: string = '';
    
      addSong() {
        this.playlis.push(this.newSong);
        this.newSong = ''; // Clear the input field
      }
    
      deleteSong(index: number) {
        this.playlis.splice(index, 1);
      }
    }
    ```
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1728630550160/f732f97f-e6de-4b28-a051-adc31826986b.png align="center")
    
21. Food Menu
    
    ```plaintext
    import {Component, Injectable} from '@angular/core';
    import {FormsModule} from "@angular/forms";
    @Injectable({
      providedIn: 'root',
    })
    @Component({
      selector: 'app-food',
      templateUrl: './food.component.html',
      styleUrl: './food.component.css'
    })
    export class FoodComponent {
      menuItems: string[] = ["Burger", "Footlong", "Salad", "Spaghetti"];
      newIte: string = '';
    
      addMenuItem() {
        this.menuItems.push(this.newIte);
        this.newIte = ''; // Clear the input field
      }
    
      deleteMenuItem(index: number) {
        this.menuItems.splice(index, 1);
      }
    }
    ```
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1728630565693/47d839b1-57d8-4b8c-89cb-f94548d3813f.png align="center")
    
22. Grocery List
    
    ```plaintext
    import {Component, Injectable} from '@angular/core';
    import {FormsModule} from "@angular/forms";
    @Injectable({
      providedIn: 'root',
    })
    @Component({
      selector: 'app-grocery',
      templateUrl: './grocery.component.html',
      styleUrl: './grocery.component.css'
    })
    export class GroceryComponent {
      groceryLis: string[] = ["Kimchi", "Paper", "Soda", "Cheese"];
      newItem: string = '';
    
      addItem() {
        this.groceryLis.push(this.newItem);
        this.newItem = ''; // Clear the input field
      }
    
      deleteItem(index: number) {
        this.groceryLis.splice(index, 1);
      }
    }
    ```
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1728630572175/bd139846-0b4d-4020-bbc0-063b7b1a6e0c.png align="center")
    
23. Classroom List
    
    ```plaintext
    import {Component, Injectable} from '@angular/core';
    @Injectable({
      providedIn: 'root',
    })
    @Component({
      selector: 'app-classroom',
      templateUrl: './classroom.component.html',
      styleUrl: './classroom.component.css'
    })
    export class ClassroomComponent {
      studentLis: string[] = ["Arabella", "Abigail", "Dionisio", "Marvin"];
      newStudent: string = '';
    
      addStudent() {
        this.studentLis.push(this.newStudent);
        this.newStudent = ''; // Clear the input field
      }
    
      deleteStudent(index: number) {
        this.studentLis.splice(index, 1);
      }
    }
    ```
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1728630577600/14902af3-2730-4011-9746-076848e19d24.png align="center")
    
24. Inventory List
    
    ```plaintext
    import {Component, Injectable} from '@angular/core';
    interface InventoryItem {
      name: string;
      quantity: number;
    }@Injectable({
      providedIn: 'root',
    })
    @Component({
      selector: 'app-inventory',
      templateUrl: './inventory.component.html',
      styleUrl: './inventory.component.css'
    })
    export class InventoryComponent {
      inventor: InventoryItem[] = [
        { name: "T-Shirt", quantity: 20 },
        { name: "Shoes", quantity: 10 }
      ];
      newItem: string = '';
      newQuantity: number = 0;
    
      addItem() {
        const newItem: InventoryItem = { name: this.newItem, quantity: this.newQuantity };
        this.inventor.push(newItem);
        this.newItem = '';
        this.newQuantity = 0;
      }
    
      deleteItem(index: number) {
        this.inventor.splice(index, 1);
      }
    }
    ```
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1728630654792/65468928-f2a5-438c-922f-1a0ebd3f8549.png align="center")
    
25. Lecture List
    
    ```plaintext
    import {Component, Injectable} from '@angular/core';
    interface Lecture {
      topic: string;
      date: Date;
    }@Injectable({
      providedIn: 'root',
    })
    @Component({
      selector: 'app-lecture',
      templateUrl: './lecture.component.html',
      styleUrl: './lecture.component.css'
    })
    export class LectureComponent {
      lectureLis: Lecture[] = [
        { topic: "Introduction to Programming", date: new Date('2024-01-15') },
        { topic: "Data Structures", date: new Date('2024-01-22') }
      ];
      newLecture: string = '';
    
      addLecture() {
        const newLecture: Lecture = { topic: this.newLecture, date: new Date() };
        this.lectureLis.push(newLecture);
        this.newLecture = '';
      }
    
      deleteLecture(index: number) {
        this.lectureLis.splice(index, 1);
      }
    }
    ```
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1728630674020/5e4a81c0-3324-4a91-bb67-63f9ac08e720.png align="center")
    
26. Stationery List
    
    ```plaintext
    import {Component, Injectable} from '@angular/core';
    import {FormsModule} from "@angular/forms";
    interface StationeryItem {
      name: string;
      quantity: number;
    }
    @Injectable({
      providedIn: 'root',
    })
    @Component({
      selector: 'app-stationery',
      templateUrl: './stationery.component.html',
      styleUrl: './stationery.component.css'
    })
    export class StationeryComponent {
      stationeryLis: StationeryItem[] = [
        { name: "Paper", quantity: 100 },
        { name: "Staplers", quantity: 10 }
      ];
      newItem: string = '';
      newQuantity: number = 0;
    
      addItem() {
        const newItem: StationeryItem = { name: this.newItem, quantity: this.newQuantity };
        this.stationeryLis.push(newItem);
        this.newItem = '';
        this.newQuantity = 0;
      }
    
      deleteItem(index: number) {
        this.stationeryLis.splice(index, 1);
      }
    }
    ```
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1728630760400/84b4d6b2-294c-4e8e-bb05-5321b9186128.png align="center")
    
27. Flower List
    
    ```plaintext
    import {Component, Injectable} from '@angular/core';
    interface Flower {
      name: string;
      quantity: number;
    }@Injectable({
      providedIn: 'root',
    })
    @Component({
      selector: 'app-flower',
      templateUrl: './flower.component.html',
      styleUrl: './flower.component.css'
    })
    export class FlowerComponent {
      flowerLis: Flower[] = [
        { name: "Sunflower", quantity: 50 },
        { name: "Rose", quantity: 20 },
        { name: "Hydrangeas", quantity: 15 }
      ];
      newFlower: string = '';
      newQuantity: number = 0;
    
      addFlower() {
        const newFlower: Flower = { name: this.newFlower, quantity: this.newQuantity };
        this.flowerLis.push(newFlower);
        this.newFlower = '';
        this.newQuantity = 0;
      }
    
      deleteFlower(index: number) {
        this.flowerLis.splice(index, 1);
      }
    }
    ```
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1728630771051/b74ec455-6b49-4b7e-a60d-5a12bbb1f0cc.png align="center")
    
28. Destination List  
    
    ```plaintext
    import {Component, Injectable} from '@angular/core';
    interface Destination {
      name: string;
    }
    @Injectable({
      providedIn: 'root',
    })
    @Component({
      selector: 'app-destination',
      templateUrl: './destination.component.html',
      styleUrl: './destination.component.css'
    })
    export class DestinationComponent {
      destinationLis: Destination[] = [
        { name: "Rome" },
        { name: "Tokyo" },
        { name: "Paris" }
      ];
      newDestination: string = '';
    
      addDestination() {
        const newDestination: Destination = { name: this.newDestination };
        this.destinationLis.push(newDestination);
        this.newDestination = '';
      }
    
      deleteDestination(index: number) {
        this.destinationLis.splice(index, 1);
      }
    }
    ```
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1728630830746/c65b1c2f-84ed-461d-9f19-e51c5d641a1a.png align="center")
    
29. Laptop List
    
    ```plaintext
    import {Component, Injectable} from '@angular/core';
    interface Laptop {
      model: string;
    }@Injectable({
      providedIn: 'root',
    })
    @Component({
      selector: 'app-laptop',
      templateUrl: './laptop.component.html',
      styleUrl: './laptop.component.css'
    })
    export class LaptopComponent {
      laptopLis: Laptop[] = [
        { model: "MacBook Pro 16" },
        { model: "Lenovo ThinkPad X1 Carbon" }
      ];
      newLaptop: string = '';
    
      addLaptop() {
        const newLaptop: Laptop = { model: this.newLaptop };
        this.laptopLis.push(newLaptop);
        this.newLaptop = '';
      }
    
      deleteLaptop(index: number) {
        this.laptopLis.splice(index, 1);
      }
    
    }
    ```
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1728630844848/29203aba-d5af-4d8f-bc91-98a8620aea43.png align="center")
    
30. Laptop Specifications List
    
    ```plaintext
    import {Component, Injectable} from '@angular/core';
    import {FormsModule} from "@angular/forms";
    interface LaptopSpec {
      model: string;
      processor: string;
      ram: number;
      storage: number;
      screenSize: number;
    }
    @Injectable({
      providedIn: 'root',
    })
    @Component({
      selector: 'app-laptopspecifications',
      templateUrl: './laptopspecifications.component.html',
      styleUrl: './laptopspecifications.component.css'
    })
    export class LaptopspecificationsComponent {
      laptopSpecsLis: LaptopSpec[] = [
        { model: "MacBook Pro 16", processor: "Apple M2 Pro", ram: 16, storage: 512, screenSize: 16.2 },
        { model: "Dell XPS 13", processor: "Intel Core i7-1360P", ram: 16, storage: 512, screenSize: 13.4 },
        { model: "Lenovo ThinkPad X1 Carbon", processor: "Intel Core i7-1360P", ram: 16, storage: 512, screenSize: 14 }
      ];
      newModel: string = '';
      newProcessor: string = '';
      newRam: number = 0;
      newStorage: number = 0;
      newScreenSize: number = 0;
    
      addLaptop() {
        const newLaptop: LaptopSpec = {
          model: this.newModel,
          processor: this.newProcessor,
          ram: this.newRam,
          storage: this.newStorage,
          screenSize: this.newScreenSize
        };
        this.laptopSpecsLis.push(newLaptop);
        this.newModel = '';
        this.newProcessor = '';
        this.newRam = 0;
        this.newStorage = 0;
        this.newScreenSize = 0;
      }
    
      deleteLaptop(index: number) {
        this.laptopSpecsLis.splice(index, 1);
      }
    }
    ```
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1728630851532/d8d78555-bdc1-4258-b4a3-ec8c0f0e5e36.png align="center")
    
31. Computer Hardware List
    
    ```plaintext
    import {Component, Injectable} from '@angular/core';
    import {FormsModule} from "@angular/forms";
    interface HardwareComponent {
      name: string;
      quantity: number;
    }@Injectable({
      providedIn: 'root',
    })
    @Component({
      selector: 'app-computerhardware',
      templateUrl: './computerhardware.component.html',
      styleUrl: './computerhardware.component.css'
    })
    export class ComputerhardwareComponent {
      hardwareLis: HardwareComponent[] = [
        { name: "RAM", quantity: 5 },
        { name: "CPU", quantity: 10 },
        { name: "Hard Drive", quantity: 8 }
      ];
      newComponent: string = '';
      newQuantity: number = 0;
    
      addComponent() {
        const newComponent: HardwareComponent = { name: this.newComponent, quantity: this.newQuantity };
        this.hardwareLis.push(newComponent);
        this.newComponent = '';
        this.newQuantity = 0;
      }
    
      deleteComponent(index: number) {
        this.hardwareLis.splice(index, 1);
      }
    }
    ```
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1728630856492/c3ec14fd-9fbb-467c-bedb-c4a2ec8cd974.png align="center")
    
32. Mobile App List
    
    ```plaintext
    import {Component, Injectable} from '@angular/core';
    interface App {
      name: string;
    }@Injectable({
      providedIn: 'root',
    })
    @Component({
      selector: 'app-mobileapp',
      templateUrl: './mobileapp.component.html',
      styleUrl: './mobileapp.component.css'
    })
    export class MobileappComponent {
      appLis: App[] = [
        { name: "Instagram" },
        { name: "WhatsApp" },
      ];
      newApp: string = '';
    
      addApp() {
        const newApp: App = { name: this.newApp };
        this.appLis.push(newApp);
        this.newApp = '';
      }
    
      deleteApp(index: number) {
        this.appLis.splice(index, 1);
      }
    }
    ```
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1728630864095/1c6b1f00-1b2e-4e64-b14e-45a3a9cf7ef1.png align="center")
    
33. Video List
    
    ```plaintext
    import {Component, Injectable} from '@angular/core';
    interface Video {
      title: string;
    }@Injectable({
      providedIn: 'root',
    })
    @Component({
      selector: 'app-video',
      templateUrl: './video.component.html',
      styleUrl: './video.component.css'
    })
    export class VideoComponent {
      videoLis: Video[] = [
        { title: "The Dark Knight" },
        { title: "Pulp Fiction" }
      ];
      newVideoTitle: string = '';
    
      addVideo() {
        const newVideo: Video = { title: this.newVideoTitle };
        this.videoLis.push(newVideo);
        this.newVideoTitle = '';
      }
    
      deleteVideo(index: number) {
        this.videoLis.splice(index, 1);
      }
    }
    ```
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1728630883121/28283cbf-afaf-4eef-8f2f-9400f2f4f1bd.png align="center")
    
34. TV Show List
    
    ```plaintext
    import {Component, Injectable} from '@angular/core';
    
    interface TVShow {
      name: string;
    }
    @Injectable({
      providedIn: 'root',
    })
    @Component({
      selector: 'app-tvshow',
      templateUrl: './tvshow.component.html',
      styleUrl: './tvshow.component.css'
    })
    export class TvshowComponent {
      showLis: TVShow[] = [
        { name: "Stranger Things" },
        { name: "Game of Thrones" }
      ];
      newShow: string = '';
    
      addShow() {
        const newShow: TVShow = { name: this.newShow };
        this.showLis.push(newShow);
        this.newShow = '';
      }
    
      deleteShow(index: number) {
        this.showLis.splice(index, 1);
      }
    }
    ```
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1728630889348/f91d6b57-0df5-499b-a826-7db050980589.png align="center")
    
35. Furniture List
    
    ```plaintext
    import {Component, Injectable} from '@angular/core';
    interface Furniture {
      name: string;
    }@Injectable({
      providedIn: 'root',
    })
    @Component({
      selector: 'app-furniture',
      templateUrl: './furniture.component.html',
      styleUrl: './furniture.component.css'
    })
    export class FurnitureComponent {
      furnitureLis: Furniture[] = [
        { name: "Sofa" },
        { name: "Chair" }
      ];
      newFurniture: string = '';
    
      addFurniture() {
        const newFurniture: Furniture = { name: this.newFurniture };
        this.furnitureLis.push(newFurniture);
        this.newFurniture = '';
      }
    
      deleteFurniture(index: number) {
        this.furnitureLis.splice(index, 1);
      }
    }
    ```
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1728630900272/225e8082-4d9d-4f08-876c-6db0222f0aea.png align="center")
    
36. Accessory List
    
    ```plaintext
    import {Component, Injectable} from '@angular/core';
    interface Accessory {
      name: string;
    }
    @Injectable({
      providedIn: 'root',
    })
    @Component({
      selector: 'app-accessory',
      templateUrl: './accessory.component.html',
      styleUrl: './accessory.component.css'
    })
    export class AccessoryComponent {
      accessoryLis: Accessory[] = [
        { name: "Charger" },
        { name: "Privacy Protector" },
        { name: "Headphones" }
      ];
      newAccessory: string = '';
    
      addAccessory() {
        const newAccessory: Accessory = { name: this.newAccessory };
        this.accessoryLis.push(newAccessory);
        this.newAccessory = '';
      }
    
      deleteAccessory(index: number) {
        this.accessoryLis.splice(index, 1);
      }
    }
    ```
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1728630906042/42086d5e-f83a-42f1-b354-5b801cf83a4c.png align="center")
    
37. Building List
    
    ```plaintext
    import {Component, Injectable} from '@angular/core';
    interface Building {
      name: string;
    }@Injectable({
      providedIn: 'root',
    })
    @Component({
      selector: 'app-building',
      templateUrl: './building.component.html',
      styleUrl: './building.component.css'
    })
    export class BuildingComponent {
      buildingLis: Building[] = [
        { name: "Main Building" },
        { name: "Science Hall" }
      ];
      newBuilding: string = '';
    
      addBuilding() {
        const newBuilding: Building = { name: this.newBuilding };
        this.buildingLis.push(newBuilding);
        this.newBuilding = '';
      }
    
      deleteBuilding(index: number) {
        this.buildingLis.splice(index, 1);
      }
    }
    ```
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1728630911813/5d4bd440-98b9-4382-954e-c7e30d384ab9.png align="center")
    
38. Painting List
    
    ```plaintext
    import {Component, Injectable} from '@angular/core';
    interface Painting {
      title: string;
    }
    @Injectable({
      providedIn: 'root',
    })
    @Component({
      selector: 'app-painting',
      templateUrl: './painting.component.html',
      styleUrl: './painting.component.css'
    })
    export class PaintingComponent {
      paintingLis: Painting[] = [
        { title: "The Starry Night" },
        { title: "Girl with a Pearl Earring" }
      ];
      newPainting: string = '';
    
      addPainting() {
        const newPainting: Painting = { title: this.newPainting };
        this.paintingLis.push(newPainting);
        this.newPainting = '';
      }
    
      deletePainting(index: number) {
        this.paintingLis.splice(index, 1);
      }
    }
    ```
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1728630917803/e71cce43-68bd-4286-921f-65740b99bb11.png align="center")
    
39. Artist List
    
    ```plaintext
    import {Component, Injectable} from '@angular/core';
    interface Artist {
      name: string;
    }
    @Injectable({
      providedIn: 'root',
    })
    @Component({
      selector: 'app-artist',
      templateUrl: './artist.component.html',
      styleUrl: './artist.component.css'
    })
    export class ArtistComponent {
      artistLis: Artist[] = [
        { name: "Leonardo de  caprio" },
        { name: "Natalie Portman" }
      ];
      newArtist: string = '';
    
      addArtist() {
        const newArtist: Artist = { name: this.newArtist };
        this.artistLis.push(newArtist);
        this.newArtist = '';
      }
    
      deleteArtist(index: number) {
        this.artistLis.splice(index, 1);
      }
    }
    ```
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1728630925255/898ec958-acd9-411f-a8b3-e46535e515b7.png align="center")
    
40. Composer List
    
    ```plaintext
    import {Component, Injectable} from '@angular/core';
    
    interface Composer {
      name: string;
    }
    @Injectable({
      providedIn: 'root',
    })
    @Component({
      selector: 'app-composer',
      templateUrl: './composer.component.html',
      styleUrl: './composer.component.css'
    })
    export class ComposerComponent {
      composerLis: Composer[] = [
        { name: "Ludwig van Beethoven" },
        { name: "Johann Sebastian Bach" }
      ];
      newComposer: string = '';
    
      addComposer() {
        const newComposer: Composer = { name: this.newComposer };
        this.composerLis.push(newComposer);
        this.newComposer = '';
      }
    
      deleteComposer(index: number) {
        this.composerLis.splice(index, 1);
      }
    }
    ```
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1728630932225/6ce303f2-e8e1-41e9-a113-4f81b699a22b.png align="center")
    
41. Podcast List
    
    ```plaintext
    import {Component, Injectable} from '@angular/core';
    interface PodcastEpisode {
      title: string;
    }
    @Injectable({
      providedIn: 'root',
    })
    @Component({
      selector: 'app-podcast',
      templateUrl: './podcast.component.html',
      styleUrl: './podcast.component.css'
    })
    export class PodcastComponent {
      episodeLis: PodcastEpisode[] = [
        { title: "Episode 2: The Big Reveal" },
        { title: "Episode 3: The Twist" }
      ];
      newEpisodeTitle: string = '';
    
      addEpisode() {
        const newEpisode: PodcastEpisode = { title: this.newEpisodeTitle };
        this.episodeLis.push(newEpisode);
        this.newEpisodeTitle = '';
      }
    
      deleteEpisode(index: number) {
        this.episodeLis.splice(index, 1);
      }
    }
    ```
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1728630936917/9314a1c3-f94b-4f68-9467-4f90908b4459.png align="center")
    
42. Exercise List
    
    ```plaintext
    import {Component, Injectable} from '@angular/core';
    
    interface Exercise {
      name: string;
      sets: number;
      reps: number;
    }@Injectable({
      providedIn: 'root',
    })
    @Component({
      selector: 'app-exercise',
      templateUrl: './exercise.component.html',
      styleUrl: './exercise.component.css'
    })
    export class ExerciseComponent {
      exerciseLis: Exercise[] = [
        { name: "Push-ups", sets: 3, reps: 10 },
        { name: "Pull-ups", sets: 3, reps: 8 }
      ];
      newExercise: string = '';
      newSets: number = 0;
      newReps: number = 0;
    
      addExercise() {
        const newExercise: Exercise = { name: this.newExercise, sets: this.newSets, reps: this.newReps };
        this.exerciseLis.push(newExercise);
        this.newExercise = '';
        this.newSets = 0;
        this.newReps = 0;
      }
    
      deleteExercise(index: number) {
        this.exerciseLis.splice(index, 1);
      }
    }
    ```
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1728630946412/16c1797a-94e5-453a-a41c-1201568498a8.png align="center")
    
43. Meal Plan List
    
    ```plaintext
    import {Component, Injectable} from '@angular/core';
    
    interface Meal {
      name: string;
      day: string;
    }@Injectable({
      providedIn: 'root',
    })
    @Component({
      selector: 'app-mealplan',
      templateUrl: './mealplan.component.html',
      styleUrl: './mealplan.component.css'
    })
    export class MealplanComponent {
      mealPla: Meal[] = [
        { name: "Breakfast Burrito", day: "Monday" },
        { name: "Pasta with Veggies", day: "Wednesday" }
      ];
      newMeal: string = '';
      newDay: string = '';
      days = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"];
    
      addMeal() {
        const newMeal: Meal = { name: this.newMeal, day: this.newDay };
        this.mealPla.push(newMeal);
        this.newMeal = '';
        this.newDay = '';
      }
    
      deleteMeal(index: number) {
        this.mealPla.splice(index, 1);
      }
    }
    ```
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1728630951959/f22083bc-32ce-415a-bedc-2e246506d047.png align="center")
    
44. Budget List
    
    ```plaintext
    import {Component, Injectable} from '@angular/core';
    interface BudgetItem {
      name: string;
      cost: number;
    }
    @Injectable({
      providedIn: 'root',
    })
    @Component({
      selector: 'app-budget',
      templateUrl: './budget.component.html',
      styleUrl: './budget.component.css'
    })
    export class BudgetComponent {
      budgetItem: BudgetItem[] = [
        { name: "Software", cost: 500 },
    
      ];
      newItem: string = '';
      newCost: number = 0;
    
      addItem() {
        const newItem: BudgetItem = { name: this.newItem, cost: this.newCost };
        this.budgetItem.push(newItem);
        this.newItem = '';
        this.newCost = 0;
      }
    
      deleteItem(index: number) {
        this.budgetItem.splice(index, 1);
      }
    
      getTotalCost(): number {
        return this.budgetItem.reduce((total, item) => total + item.cost, 0);
      }
    }
    ```
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1728630957263/0572c20f-e345-40d4-9ffe-a5413be71304.png align="center")
    
45. Presentation List
    
    ```plaintext
    import {Component, Injectable} from '@angular/core';
    
    interface PresentationTopic {
      name: string;
    }@Injectable({
      providedIn: 'root',
    })
    @Component({
      selector: 'app-presentation',
      templateUrl: './presentation.component.html',
      styleUrl: './presentation.component.css'
    })
    export class PresentationComponent {
      topicLis: PresentationTopic[] = [
        { name: "Sustainable Living Practices" },
        { name: "The History of Music" }
      ];
      newTopic: string = '';
    
      addTopic() {
        const newTopic: PresentationTopic = { name: this.newTopic };
        this.topicLis.push(newTopic);
        this.newTopic = '';
      }
    
      deleteTopic(index: number) {
        this.topicLis.splice(index, 1);
      }
    }
    ```
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1728630963846/910c2fca-e603-454c-bb40-c3c1ef275a01.png align="center")
    
46. Tour List
    
    ```plaintext
    import {Component, Injectable} from '@angular/core';
    interface TourDate {
      city: string;
      date: Date;
    }
    @Injectable({
      providedIn: 'root',
    })
    @Component({
      selector: 'app-tour',
      templateUrl: './tour.component.html',
      styleUrl: './tour.component.css'
    })
    export class TourComponent {
      tourDate: TourDate[] = [
        { city: "Los Angeles", date: new Date('2024-03-22') },
        { city: "Chicago", date: new Date('2024-03-29') }
      ];
      newCity: string = '';
      newDate: Date = new Date();
    
      addTourDate() {
        const newTourDate: TourDate = { city: this.newCity, date: this.newDate };
        this.tourDate.push(newTourDate);
        this.newCity = '';
        this.newDate = new Date();
      }
    
      deleteTourDate(index: number) {
        this.tourDate.splice(index, 1);
      }
    }
    ```
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1728630970290/42e90090-dbcb-4509-afc2-9c21d7287e7d.png align="center")
    
47. Event List
    
    ```plaintext
    import {Component, Injectable} from '@angular/core';
    interface Event {
      name: string;
      date: Date;
    }@Injectable({
      providedIn: 'root',
    })
    @Component({
      selector: 'app-event',
      templateUrl: './event.component.html',
      styleUrl: './event.component.css'
    })
    export class EventComponent {
      eventLis: Event[] = [
        { name: "Tech Conference", date: new Date('2024-09-20') },
        { name: "Art Exhibition", date: new Date('2024-11-05') }
      ];
      newEvent: string = '';
      newDate: Date = new Date();
    
      addEvent() {
        const newEvent: Event = { name: this.newEvent, date: this.newDate };
        this.eventLis.push(newEvent);
        this.newEvent = '';
        this.newDate = new Date();
      }
    
      deleteEvent(index: number) {
        this.eventLis.splice(index, 1);
      }
    }
    ```
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1728630976069/04d01298-b4ce-49e6-9642-5574a8677ff9.png align="center")
    
48. Developer Tools List
    
    ```plaintext
    import {Component, Injectable} from '@angular/core';
    interface DevTool {
      name: string;
      category: string;
    }@Injectable({
      providedIn: 'root',
    })
    @Component({
      selector: 'app-developer',
      templateUrl: './developer.component.html',
      styleUrl: './developer.component.css'
    })
    export class DeveloperComponent {
      devToolsLis: DevTool[] = [
        { name: "Visual Studio Code", category: "Code Editor" },
        { name: "Git", category: "Version Control" },
      ];
      newTool: string = '';
      newCategory: string = '';
    
      addTool() {
        const newTool: DevTool = { name: this.newTool, category: this.newCategory };
        this.devToolsLis.push(newTool);
        this.newTool = '';
        this.newCategory = '';
      }
    
      deleteTool(index: number) {
        this.devToolsLis.splice(index, 1);
      }
    }
    ```
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1728630984342/e4ee2623-f07c-4d25-8f25-ae6371679d56.png align="center")
    
49. Framework List
    
    ```plaintext
    import {Component, Injectable} from '@angular/core';
    interface Framework {
      name: string;
      type: string;
    }@Injectable({
      providedIn: 'root',
    })
    @Component({
      selector: 'app-framework',
      templateUrl: './framework.component.html',
      styleUrl: './framework.component.css'
    })
    export class FrameworkComponent {
      frameworkLis: Framework[] = [
        { name: "Angular", type: "Front-End" },
        { name: "Vue.js", type: "Front-End" },
        { name: "Express.js", type: "Back-End" },
        { name: "Django", type: "Back-End" }
      ];
      newFramework: string = '';
      newType: string = '';
      frameworkTypes = ["Front-End", "Back-End", "Full-Stack"];
    
      addFramework() {
        const newFramework: Framework = { name: this.newFramework, type: this.newType };
        this.frameworkLis.push(newFramework);
        this.newFramework = '';
        this.newType = '';
      }
    
      deleteFramework(index: number) {
        this.frameworkLis.splice(index, 1);
      }
    }
    ```
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1728630989873/7dcfa762-d76c-4a9c-ae6c-4baa45a5ebed.png align="center")
    
50. Library List
    
    ```plaintext
    import {Component, Injectable} from '@angular/core';
    interface Library {
      name: string;
    }@Injectable({
      providedIn: 'root',
    })
    @Component({
      selector: 'app-library',
      templateUrl: './library.component.html',
      styleUrl: './library.component.css'
    })
    export class LibraryComponent {
      libraryLis: Library[] = [
        { name: "lodash" },
        { name: "axios" }
      ];
      newLibrary: string = '';
    
      addLibrary() {
        const newLibrary: Library = { name: this.newLibrary };
        this.libraryLis.push(newLibrary);
        this.newLibrary = '';
      }
    
      deleteLibrary(index: number) {
        this.libraryLis.splice(index, 1);
      }
    }
    ```
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1728630996256/bee58a21-cb1c-44b0-82ca-c425a8037887.png align="center")
    
      
    
      
    GITHUB LINK:  
    [https://github.com/Gerliedao-ayan/Activity-15.git](https://github.com/Gerliedao-ayan/Activity-15.git)  
    
    FIREBASE LINK:
    
    [https://activity-15.web.app](https://activity-15.web.app)
