title: Getting a unique array from a service in Angular
body: <p>I have a service that contains information about members. One of the variables here is the team string.</p>
  
  <p>In my component, I call the service method to put the information in a variable before showing it in the component.</p>
  
  <p>I would like to fill the variable "teams" in my component with an unique list of teams in the service. This should take into account writing (so I would use toUpperCase()).</p>
  
  <p>My service:</p>
  
  <pre><code>import { Injectable } from '@angular/core';
  
  @Injectable()
  export class UserinfoService
  {
      //methods or services
      getMembers()
      {
          return [
              {
                  imageUrl: "../assets/images/filler.jpg",
                  firstName: "filler",
                  lastName: "filler",
                  team: "TEAM A",
                  number: "+123456798",
                  bio: "Lorem ipsum dolor sit amet,...",
                  isActive: true
              },
              {
                  imageUrl: "../assets/images/filler.jpg",
                  firstName: "filler",
                  lastName: "filler",
                  team: "TEam A",
                  number: "+123456798",
                  bio: "Lorem ipsum dolor sit amet,...",
                  isActive: false
              },
              {
                  imageUrl: "../assets/images/filler.jpg",
                  firstName: "filler",
                  lastName: "filler",
                  team: "TEAM B",
                  number: "+123456798",
                  bio: "Lorem ipsum dolor sit amet,...",
                  isActive: true
              },
          ];
      }
      //constructor
      constructor()
      {
      }
  }
  </code></pre>
  
  <p>my component:</p>
  
  <pre><code>import { Component, OnInit } from '@angular/core';
  import { UserinfoService } from '../services/userinfo.service';
  
  
  @Component({
    selector: 'app-teammembers',
    templateUrl: './teammembers.component.html',
    styleUrls: ['./teammembers.component.css']
  })
  export class TeammembersComponent implements OnInit
  {
      //props
      teammembers: any[];
      teams:any[];
  
      constructor(userinfoService: UserinfoService)
      {
          //getData
          this.teammembers = userinfoService.getMembers();
      }            
  
    ngOnInit() {
    }
  }
  </code></pre>