title: How to store the passed data from another page in Ionic 5?
body: <p><strong>This is my page ts code where i am going to pass the data to another page</strong></p>
  <pre><code>import { Component, OnInit } from '@angular/core';
  import { NavigationExtras, Router } from '@angular/router';
  
  export class CompListPage implements OnInit {
  opencomp(complaint) {
      let comptype = complaint.comp_type;
      let navigationExtras: NavigationExtras = {
        state: { data: complaint, comptype },
      };
      this.router.navigate(['comp-detail'], navigationExtras);
    }
  }
  </code></pre>
  <p><strong>This is my ts code where i am receiving data</strong></p>
  <pre><code>import { Component, OnInit } from '@angular/core';
  import { Router, ActivatedRoute } from '@angular/router';
  
  export class CompDetailPage implements OnInit {
  constructor(
      private router: Router,
      private activateroute: ActivatedRoute ) 
      {
      this.activateroute.queryParams.subscribe((params) =&gt; {
        this.complaintdata = this.router.getCurrentNavigation().extras.state.data;
        console.log(this.complaintdata);
      });
    }
  }
  </code></pre>
  <p>Can anyone help me to save the passed data in my current page</p>