Visual Studio 2013 で json または i18n ファイルを読み込む際に問題が発生しました。なお、sap hana studio 環境では問題ありません。
以下は私のコードです:
<script src="https://sapui5.hana.ondemand.com/resources/sap-ui-core.js"
id="sap-ui-bootstrap"
data-sap-ui-libs="sap.m,sap.ui.commons,sap.ui.table"
data-sap-ui-theme="sap_bluecrystal"
data-sap-ui-resourceroots='{"sap.ui.demo.myFiori": "./"}'>
</script>
var oView = sap.ui.view({
id : "app",
viewName : "sap.ui.demo.myFiori.view.App",
type : "JS",
viewData : { component : this }
});
var i18nModel = new sap.ui.model.resource.ResourceModel({
bundleUrl : "i18n/messageBundle.properties"
});
oView.setModel(i18nModel, "i18n");
var oModel = new sap.ui.model.json.JSONModel("model/mock.json");
oView.setModel(oModel);
以下は、私のビジュアル スタジオ 2013 ディレクトリです。
- UI5Application3
-i18n
-i18n.properties
-messageBundle.properties
-モデル
-mock.json
私を助けてください。あなたの提案はすべて高く評価されています