1
votes

i am getting the value of a variable var= ezLinkCard in below code in one of the view controller and want to pass or read this variable value in another view controller.How can i acheive this? your help is appriciated.

onRouteMatched: function(oEvent) {

    var oView = this.getView();
    var navigationDestinationView = oEvent.getParameter("name");
    if (navigationDestinationView === "initial" || navigationDestinationView === "initial1") {
        var ezLinkCard = oEvent.getParameter("arguments").cardNumber;
        if (ezLinkCard !== undefined && ezLinkCard !== null && ezLinkCard !== "") {
            this.getValidUserId(ezLinkCard);
        }
    }
},
1
did you get it to work by now? - Erch

1 Answers

3
votes

There are 3 options:

  • Models
  • Event Bus
  • Parameter in your Navigation

To know which variant fits best for you and really understanding the conzepts I advice you to do follwoing tutorials for models and navigation parameter:

For understanding the event bus following question might help (or at least the answer to it):