Passing params to a component in Ionic 2
<p>I'm trying to pass a parameter (a hash object) from one of my pages to a component. </p>

<p>I can access the object from the view of the component. But what I want is to read it first from the code (<code>.ts</code>) and then pass to the view.</p>

<p>This is my code</p>

<pre><code>#main page component
&lt;selected-options [node]="node"&gt;&lt;/selected-options&gt;

#selected-options component code
import { Component, Input } from '@angular/core';
import { NavController, NavParams } from 'ionic-angular';

@Component({
  selector: 'selected-options',
  templateUrl: 'build/components/selected-options/selected-options.html',
  inputs: ['node']
})
export class SelectedOptions {

  @Input() node: any;
  private selectedNodes: any;      

  constructor(public ryvuss: Ryvuss, public nav: NavController, public navParams: NavParams) {
     // I want to read the node object in here
     this.node = navParams.get('node');
     this.selectedNodes = //dosomething with node
  }
}

#selected-options component html view
&lt;div *ngFor="let selected of selectedNodes"&gt;
  //loop
&lt;/div&gt;
</code></pre>

<p>If I directly access the node from  view it works <code>&lt;div *ngFor="let selected of node"&gt;</code></p>

<p>But how can I access the params passed in to the components from component code itself ?</p>