title: Storing data in an array angular
body: <p>How do I check with the console to see if I'm actually storing the ids inside my domain array? If I try to put the console.log outside of the function nothing appears. I'm just not quite sure if I'm saving them or not.</p>
  
  <p>What I would like to accomplish with this, is using that values of that array and passing them to my child component using @input decorator.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>import {
    Component,
    OnInit,
    Input
  } from '@angular/core';
  import {
    Router,
    ActivatedRoute,
    ParamMap
  } from '@angular/router';
  import {
    Location
  } from '@angular/common';
  import {
    ImageService
  } from './shared/image.service';
  import {
    DomainService
  } from '../domain.service';
  import {
    GraphService
  } from '../graph.service';
  import {
    LibraryService
  } from '../library.service';
  import {
    Domain
  } from '../library';
  import {
    Library
  } from '../library';
  import {
    map,
    mergeMap
  } from 'rxjs/operators';
  
  
  @Component({
    selector: 'app-metric-details',
    templateUrl: './metric-details.component.html',
    styleUrls: ['./metric-details.component.css']
  })
  export class MetricDetailsComponent implements OnInit {
  
    visibleImages: any[] = [];
    activeId = 0;
    domain: Domain[];
  
    constructor(private imageService: ImageService, private domainService: DomainService, private libraryService: LibraryService, private graphService: GraphService, private location: Location, private route: ActivatedRoute, private router: Router) {
      this.visibleImages = this.imageService.getImages();
  
    }
  
    ngOnInit() {
      this.route.params.subscribe(params =&gt; {
          {
            this.activeId = +params['id'];
            console.log(this.activeId) //log the entire params object
            // console.log(params['id']) //log the value of id
            // const id = +this.route.snapshot.paramMap.get('id');
            // console.log(id);
            console.log(this.domainService.getDomain(this.activeId));
            this.domainService.getDomain(this.activeId).subscribe(domain =&gt; this.domain = domain)
            console.log("YOOO", this.domain)
  
          }
        }
      }</code></pre>
  </div>
  </div>
  </p>