on 06-30-2016 6:43 PM
I am learning ui5 via webide and have to assign a global variable that can be used in any controller. I tried assigning a new variable
'var testglobalvariable=null;' in the controller as below, but ide throws an error everytime. How to assign ?
var testglobalvariable=null;
sap.ui.define([
"sap/ui/core/mvc/Controller"
], function(Controller) {
"use strict";
return Controller.extend("testapp.controller.View1", {
});
});
you can add it to your model... and then you can access this variable from the model through your application
get a handle of your model... then... you can set it via..
model.setProperty('/varName', value)
and to retrieve it
model.getProperty('/varName')
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.