or123456
or123456

Reputation: 2199

best way for pass very big object between two pages with routing

I want to pass big object between two pages .
project hangs(chunk error) when using of queryparam for routing big object.
What is the best way for pass big object between two pages with routing ?

Upvotes: 0

Views: 42

Answers (1)

Sjoerd de Wit
Sjoerd de Wit

Reputation: 2413

You can create a dataService to share data:

import { Injectable } from '@angular/core';

@Injectable()
export class DataSharingService {
  public data: any[] = [];

  constructor() { }

  set(property, data) {
    this.data[property] = data;
  }

  get(property) {
    return this.data[property];
  }
}

Upvotes: 1

Related Questions