Search code examples
angularjswebstorm

John Papa angularjs style guide webstorm live templates


I am using Webstorm 2016.1 and trying to configure the templates from John Papa (https://github.com/johnpapa/angular-styleguide/blob/master/a1/README.md#style-y252) Where exactly do I copy the template xml files? How do I activate/use them in Webstorm ?


Solution

  • After some research I found a way to do it. On a Mac do the following:

    To test: In a JavaScript file type ngcontroller followed by the Tab key. You should the see the following appear:

        (function () {
            'use strict';
    
            angular
                .module('moduleName')
                .controller('ControllerName', ControllerName);
    
            ControllerName.$inject = ['dependency'];
    
            /* @ngInject */
            function ControllerName(dependency) {
                var vm = this;
                vm.title = 'ControllerName';
    
                activate();
    
                ////////////////
    
                function activate() {
                    code
                }
            }
    
        })();