openui5vscodeTypescriptTools
openui5vscodeTypescriptTools copied to clipboard
Command to generate sap.ui.define imports
Create a command to automatically add imports like:
import JSONModel = sap.ui.model.json.JSONModel;
to the sap.ui.define
Command can be called via autocomplete, too.
is it like done here? https://marketplace.visualstudio.com/items?itemName=tapsiturbi-publisher.openui5-require
Yes, but not for typescript. Or have you tried it out? Does it work with that extension?
This:
sap.ui.define([
], function() {
Controller.extend("app.controller.pages.FirstPage");
});
namespace app.controller.pages {
import Controller = sap.ui.core.mvc.Controller;
export class FirstPage extends Controller {
onInit() {
console.log("Initializing FirstPage Controller");
console.log("Testchange");
}
}
}
Should become this:
sap.ui.define([
"sap/ui/core/mvc/Controller"
], function(Controller: sap.ui.core.mvc.Controller) {
Controller.extend("app.controller.pages.FirstPage");
});
namespace app.controller.pages {
import Controller = sap.ui.core.mvc.Controller;
export class FirstPage extends Controller {
onInit() {
console.log("Initializing FirstPage Controller");
console.log("Testchange");
}
}
}
Based on import bla = blub
I am not sure, if this extension does the trick for typescript.