saschakiefer / generator-openui5

yeoman generator for OpenUI5 applications and assets
Other
64 stars 17 forks source link

Component generator adds invalid string to index.html #54

Closed saschakiefer closed 10 years ago

saschakiefer commented 10 years ago

When the component controller doesn't find the comment /* endOfResources */ in index.html, it adds sap.ui.localResources( "myDir" ); at the beginning of index.html. if the hook isn't found, the generator should do nothing.

js1972 commented 10 years ago

We only want to use sap.ui.localResources( "myDir" ); on a classic app. For the Fiori-like apps that use the component model we use the UI5 bootstrap tag to specify resource roots instead.

So we need to detect what sort of app the new component is being generated in. If its classical then use this.addLocalResource(this.componentName);; if its fiori-like then skip this and ....

a) Do we need to add a new resource root? We don't if we are going to prefix the component name with the apps namespace as it already has that resource root defined.

b) If we don't prefix the component name with the apps namespace then we would need to add the component name as a resource root. (the above two options depend on issue #47.)

saschakiefer commented 10 years ago

Even though the generator checks for Application.js or Component.js, I still want to add a check if the heystack is found.