Skip to content

Empty Directive Template

Joshua Wiens edited this page Mar 7, 2016 · 3 revisions

Usage

  1. Type "ng2" which will bring up the templates list & "d" to scope to Directive Templates
  2. Arrow key to ng2directive and hit enter

This is a bare bones @Directive, check the other Directive Templates for robust snippets

Alternate Usage ( Preferred )

For the most basic Live Templates, it's just as productive if not more to just use the built-in completion provided with the TypeScript package.

  1. Type "@Direc" and hit enter

Here is why it's faster ...

import {Directive} from 'angular2/core';

The module import is added automatically to the top of the file. If an import for the 'angular2/core' module already exists, it is added to the list.

Demo