Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added absolut path #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions Component.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,17 @@ sap.ui.core.UIComponent.extend("sap.ui.demo.myFiori.Component", {
type : "JS",
viewData : { component : this }
});

// get absolut path to the files
var rootPath = jQuery.sap.getModulePath("sap.ui.demo.myFiori");

// set data model on root view
var oModel = new sap.ui.model.json.JSONModel("model/mock.json");
var oModel = new sap.ui.model.json.JSONModel( rootPath + "/model/mock.json");
oView.setModel(oModel);

// set i18n model
var i18nModel = new sap.ui.model.resource.ResourceModel({
bundleUrl : "i18n/messageBundle.properties"
bundleUrl : rootPath + "/i18n/messageBundle.properties"
});
oView.setModel(i18nModel, "i18n");

Expand Down