0

I am building a graphical web application using Angular2 and Typescript, which allows users to create flowcharts.

My next task is to implement a copy and paste feature of flowchart objects. A user should be able to right click a flow chart object to copy, then right click somewhere on the screen and paste that object. However, I want the data to be available for pasting into another tab. So, if a user has two instances of my application running in two different tabs, and copy's an object from one tab, I want the user to be able to paste that object into the other tab.

These flow chart objects are just a typescript class. For example:

export class AbstractFlowChartObject {
     //variables

     //methods
}

I have set up my copy function to save a reference to the object that has been clicked as such:

var objectToCopy : AbstractFlowChartObject = whateverObjectWasClicked;

How can I expose this variable to another instance of my application running in a different tab?

I want this to happen purely on the client side. In addition, the data I want to send across is a complex object with many variables and child objects, not something as simple as sending a JSON object or a string.

JavascriptLoser
  • 1,713
  • 3
  • 25
  • 50

1 Answers1

0

This is not related to TypeScript or the use of classes in any way. A variety of solutions such as local storage, or simply posting the entire object back to the server are available but limited.

In that sense this questions a duplicate of questions such as Javascript: sharing data between tabs - Stack Overflow

Community
  • 1
  • 1
Aluan Haddad
  • 23,170
  • 5
  • 56
  • 69
  • I want this to happen purely on the client side. In addition, the data I want to send across is a complex object with many variables and child objects, not something as simple as sending a JSON object or a string. – JavascriptLoser Feb 01 '17 at 05:50