title: Angular Type 'void' is not assignable to type 'any[]
body: <p>Getting the following error. Type 'void' is not assignable to type 'any[].  I found similar questions, but I cant figure out how I would apply it to my situation. </p>
  
  <p>Not sure if the mistake is in the OnInIt function or in the line -> @Input() networks = []</p>
  
  <p>//service.ts </p>
  
  <pre><code> @Injectable({providedIn: 'root'})
   export class NetworkService{
  
       private networks: Profile[] = [];
  
      constructor(private http: HttpClient){}
  
       getNetworks(){
         this.http.get&lt;{message: string, profiles: Profile []}&gt;('http://localhost:3000/api/profiles')
       .subscribe((profileData)=&gt;{
           console.log(profileData)
           this.networks = profileData.profiles;
       });
   }
  </code></pre>
  
  <p>}</p>
  
  <p>//component.ts</p>
  
  <pre><code>  export class NetworkComponent implements OnInit {
  
      @Input() networks = [];
  
      constructor(public networkService: NetworkService) { }
  
      ngOnInit() {
         this.networks = this.networkService.getNetworks()
  
     }
  </code></pre>
  
  <p>}</p>
  
  <p>Trying to pass info from the service to the component.  networks = [] should be assigned an array of objects.</p>