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

Command to generate sap.ui.define imports #10

Open
apazureck opened this issue Dec 23, 2016 · 2 comments
Open

Command to generate sap.ui.define imports #10

apazureck opened this issue Dec 23, 2016 · 2 comments

Comments

@apazureck
Copy link
Owner

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.

@antonsn
Copy link

antonsn commented Mar 28, 2017

@apazureck
Copy link
Owner Author

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.

@apazureck apazureck self-assigned this Jun 27, 2017
@apazureck apazureck added this to the Backlog milestone Jun 27, 2017
@apazureck apazureck removed their assignment Jun 27, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

No branches or pull requests

2 participants