Shortcut for creating javascript function in webstorm / intellij

I saw on EggHead a blog of some AngularJS javascript application coding videos. I understand that every time he types $scope.x = fun , the code ends and he types some shortcut (which I donโ€™t know), which creates the following expression:

 $scope.x = function () { } 

The normal code is complete, ctrl + space , gives me:

 $scope.x = function 

Does anyone know this shortcut or how to configure it?

+4
source share
2 answers

Most likely, it has a custom Live Template that extends fun with Tab to:

 function () { } 

The template may look like this:

 function () { $END$ } 

Where $END$ denotes the end position of the cursor after expansion.

+6
source

You should learn the IntelliJ Live Templates feature. He could create his own template for this.

+2
source

Source: https://habr.com/ru/post/1492187/


All Articles