Szymon Wygnański
Szymon Wygnański

Reputation: 11064

PhpStorm Live Templates: variables that are in contact

I'm trying do define this live template:

/*jslint browser:true*/
/*global $module$, jQuery, angular*/
(function () {

    'use strict';

    angular.module('$module$').directive('$module$$name$', function () {
        return {
            restrict: 'A',
            templateUrl: '/$module$/views/$name$/$name$.html',
            controller: ['$scope',
                function ($scope) {
                    $END$
                }]
        };
    });

}());

But $module$$name expression couses silent error.

How to concatenate two variables in PhpStorm's Live Template?

Upvotes: 1

Views: 737

Answers (1)

Peter Gromov
Peter Gromov

Reputation: 18931

Please watch/vote for http://youtrack.jetbrains.com/issue/IDEA-89020.

You could also try to change the variable sequence so that you enter $module$ and $name$ in the place where they're separate, and the concatenated place is filled automatically. For that, you can define separate variables for the concatenation (Always stop at=false) and make their expressions equal to the values of $module$ and $name$ respectively.

Upvotes: 2

Related Questions