ialexivy / vscode-angular2-files

vscode extension generating angular files with angular cli
MIT License
61 stars 36 forks source link
angular extension vscode

VS Code Angular Files

This extension allows quickly scaffold angular 2 file templates in VS Code project.

Inspired by angular-cli (https://github.com/angular/angular-cli)

Changelog

1.6.4

1.6.2

1.6.1

1.6.0

You can now leverage angular-cli resource generation options without remembering their names, while keeping things simple and fast!

Angular Files will automatically scan you angular.json to determine which default options you have already set and will let you to override them while displaying the current values

1.5.2

1.5.1

1.5.0

1.4.9

1.4.7

1.4.6

1.4.5

1.4.3

1.4.2

1.4.1

1.4.0

1.3.10

1.3.9

    "defaults": {
        "styleExt": "css",
        "component": {
            "spec": true,
            "inlineStyle": false,
            "inlineTemplate": false,
            "flat": false,
            "changeDetection": "Default",
            "viewEncapsulation": "Emulated"
        },
        "class": {
            "spec": false
        }, 
        "directive": {
            "flat": true,
            "spec": true
        },
        "guard": {
            "flat": true,
            "spec": true
        },
        "interface": {
            "prefix": ""
        },
        "module": {
            "flat": false,
            "spec": false
        },
        "pipe": {
            "flat": true,
            "spec": true
        },
        "service": {
            "flat": true,
            "spec": true
        }
    }

1.3.8

1.3.7

1.3.6

1.3.5

1.3.4

1.3.2

1.3.1

1.3.0

1.1.0

1.0.0

Features

Right click on a file or a folder in your current project. You can find multiple options been added to the context menu:

Menu Options
New Component
New Directive
New Pipe
New Service
New Module
Menu Options
New Class
New Interface
New Enum

Override default configuration like app prefix and style: Create a angular-cli.json (can be used without angular-cli):

{
   "apps":[
      {
         "root":"src",
         "prefix":"app"
      }
   ],
   "defaults":{
      "styleExt":"css"
   }
}

The naming of the files as well as the (boilerplate) snippets are based on the official Angular Style Guide

Installation

  1. Install Visual Studio Code 1.5.0 or higher
  2. Launch Code
  3. From the command palette Ctrl-Shift-P (Windows, Linux) or Cmd-Shift-P (OSX)
  4. Select Install Extension
  5. Type angular files and press enter
  6. Reload Visual Studio Code

Disclaimer

Important: This extension due to the nature of it's purpose will create files on your hard drive and if necessary create the respective folder structure. While it should not override any files during this process, I'm not giving any guarantees or take any responsibility in case of lost data.

License

MIT