ng2-webstorm-snippets

来源:互联网 发布:apache服务器 ubuntu 编辑:程序博客网 时间:2024/06/06 19:26

用法

输入格式指令 按enter或tab即可

Installing the templates

From JetBrains Plugin repository

  • Open IDE preferences Cmd + ,
  • Go to Plugins -> Browse repositories
  • Type angular and install Angular 2 TypeScript Templates
  • Restart WebStorm

By Copy xml file

    Clone repo or download ng2-templates.xml
    Place the XML file in your templates folder
On OSX that would be ~/Library/Preferences/WebStorm{Version}/templates
  • Restart WebStorm

Usage

Type part of a snippet, press enter, and the snippet unfolds.

TypeScript Angular Snippets

a-component                 // componenta-component-root            // root app componenta-directive                 // directivea-guard-can-activate        // CanActivate guarda-guard-can-activate-child  // CanActivateChild guarda-guard-can-deactivate      // CanDeactivate guarda-guard-can-load            // CanLoad guarda-http-get                  // http.get with Rx Observablea-module                    // modulea-module-root               // root app modulea-module-routing            // routing module file (forChild)a-output-event              // @Output event and emittera-pipe                      // pipea-route-path-404            // 404 route patha-route-path-default        // default route patha-route-path-eager          // eager route patha-route-path-lazy           // lazy route patha-service                   // servicea-service-http              // service with Httpa-ctor-skip-self            // angular ngmodule's skipself constructora-subscribe                 // Rx Observable subscription

TypeScript RxJS Snippets

rx-observable               // Rx Observable importrx-subject                  // Rx Subject importrx-replay-subject           // Rx ReplaySubject importrx-behavior-subject         // Rx BehaviorSubject importrx-add-operator             // Rx add operator importrx-add-observable           // Rx add observable import

HTML Snippets

a-class                     // [class] bindinga-select                    // <select> controla-style                     // [style] bindinga-ngClass                   // ngClassa-ngFor                     // *ngFora-ngForAsync                // *ngFor with asynca-ngIf                      // *ngIfa-ngIfElse                  // *ngIf with elsea-ngModel                   // ngModela-routerLink                // routerLinka-routerLink-param          // routerLink with a route parametera-ngStyle                   // ngStylea-ngSwitch                  // ngSwitcha-prej                      // pre debug | jsona-preja                     // pre debug | async | json
原创粉丝点击