title: Pass array of int in Angular Route
body: <p>Well, I did some research before asking this question. </p>
  
  <p>This is my path</p>
  
  <pre><code>{ path: 'cart/:productIds', component: CartComponent }
  </code></pre>
  
  <p>I want to pass productIds when click on cart like below in AppComponent. Can I do this ?</p>
  
  <pre><code> goToCart() {
  this.router.navigate(['/cart', this.productIds]);}
  </code></pre>
  
  <p>Am trying to access these productIds in ngOnit in cartcomponent like this</p>
  
  <pre><code>this.productIds = route.snapshot.params["productIds"];
  </code></pre>
  
  <p>My question is, Is this the efficient way of passing and accessing array of Int between two components?</p>
  
  <p>how do we maintain state(not sure whether this is right word, my background is ASP.NET) between components ?</p>