I am trying to solve problem with code completition using Angular 1 components. Here is a very simple code:

export default angular.module('gridService', [])
    .component('grid', {
        templateUrl: 'services/gridService/grid.tpl.html',
        controller: GridController,
        bindings: {
            items: '='

function GridController() {
    this.omg = 'wtf';
    //this.items is not autocompleted

Is there an IDE, that would autocomplete binded items in the controller? I have already tried: WebStorm (configured according to their blogpost), Brackets, SublimeText2, Eclipse, Angular IDE, IDEA and my trusty PSPad :) None of them seems to be able to autocomplete this kinda trivial thing.

I mean come on, where is the problem? If the IDE has support for Angular, then it should be able to read its syntax, and here I just declare, that for grid component I am using GridController function and I am binding items property. Why it can't autocomplete items inside the controller? Is there some technical issue I just can't see that is making this problem unsolveable?

Not to mention that there is absolutely NO support for autocomplete components in templates. I mean yeah, the IDE can autocomplete the component name, so in this case I can write gr + Ctrl + Space and it autocompletes <grid></grid>, but inside grid template (which is again defined in component syntax) I have zero autocomplete. In Angular there is default binding to controller in component to $ctrl (https://docs.angularjs.org/guide/component), so the IDE CAN link the $ctrl in template I am in with according component and its controller.

So, back to my first question, can you recommend me IDE that can autocomplete this?

  • 1
    You might have to write your own scripts for this – Felix D. Dec 8 '16 at 21:32
  • 1
    Yeah I was hoping not to :) – Pirozek Dec 9 '16 at 7:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.