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.