У меня проблемы с загрузкой библиотек amcharts в SAPUI5.Я хочу загрузить 3 библиотеки amCharts, ядро, графики и анимацию.У меня они есть в структуре моего проекта в папке с именем libs ... обратите внимание, что я хочу использовать файл component.js, а не index.html, поскольку мое приложение будет запущено с панели запуска Fiori.
ПослеНесколько полезных советов: теперь я загружаю их в файл manifest.json, как показано ниже
"resources": {
"js": [
{
"uri": "libs/core.js"
},
{
"uri": "libs/charts.js"
},
{
"uri": "libs/animated.js"
}
],
"css": [
{
"uri": "css/style.css"
}
]
},
, когда я тестирую приложение через файл index.html ... оно работает!
, когда ятест с использованием файла component.js Я получаю следующую ошибку в консоли
Failed to load resource: the server responded with a status of 404 ()
The issue is most likely caused by application znrw.amCharts. Please create a support incident and assign it to the support component of the respective application. - Failed to load UI5 component with properties: '{
"asyncHints": {
"waitFor": []
},
"name": "znrw.amCharts",
"url": "../../../../../webapp",
"id": "application-Test-url-component",
"componentData": {
"startupParameters": {}
},
"async": true
}'. Error likely caused by:
TypeError: Cannot read property '1' of null
ошибка в панели запуска
, поэтому мой вопрос, нужно ли что-то добавитьв файл component.js, чтобы получить библиотеки для загрузки?или мне нужно сделать что-то еще в файле manifest.json?
В настоящее время файл компонента выглядит следующим образом:
"sap/ui/core/UIComponent",
"sap/ui/Device",
"znrw/amCharts/model/models"
], function (UIComponent, Device, models) {
"use strict";
return UIComponent.extend("znrw.amCharts.Component", {
metadata: {
manifest: "json"
},
/**
* The component is initialized by UI5 automatically during the startup of the app and calls the init method once.
* @public
* @override
*/
init: function () {
// call the base component's init function
UIComponent.prototype.init.apply(this, arguments);
// enable routing
this.getRouter().initialize();
// set the device model
this.setModel(models.createDeviceModel(), "device");
}
});
});