ReSharper 2018.1 Help

Predefined Live Templates for Angular 2 HTML

ReSharper | Templates Explorer | Live Templates | Angular 2 HTML

This topic lists all predefined live templates for Angular 2 HTML in ReSharper 2018.1. For more information about live templates, see Creating Source Code Using Live Templates

TemplateDetails
ctx

Current file context

Scope everywhere

Body

$CTX$

Parameters

  • CTX - Provides list of items describing current context. This includes file name, containing type name, namespace name, etc. (context)
nguid

Insert new GUID

Scope everywhere

Body

$GUID$

Parameters

  • GUID - Generates new Globally Unique Identifier (GUID) (guid)
<script

Create script tag

Scope HTML and similar tags

Body

<script type="$attributeValue$">$END$</script>

Parameters

  • attributeValue - Suggest attribute value for current html tag attribute (suggestAttributeValue)
  • END - The caret position after the template is applied.
a

Create tag attribute

Scope HTML and similar attributes

Body

$ATTR$="$END$"

Parameters

  • ATTR - Suggests attribute name used in the same tags in current document (suggestAttributeNameByTag)
  • END - The caret position after the template is applied.
ngClass

Scope Angular 2 HTML attributes

Body

[ngClass]="{'$cssClass$': $expression$}"$END$

Parameters

  • cssClass - no macro
  • expression - Displays the specified list of values. (list)
  • END - The caret position after the template is applied.
ngFor

Scope Angular 2 HTML attributes

Body

*ngFor="let $item$ of $list$"$END$

Parameters

  • item - Suggests visible variable that can be enumerated (that is, used in foreach loop as collection) (enumerableVariable)
  • list - no macro
  • END - The caret position after the template is applied.
ngIf

Scope Angular 2 HTML attributes

Body

*ngIf="$expression$"$END$

Parameters

  • expression - no macro
  • END - The caret position after the template is applied.
ngModel

Scope Angular 2 HTML attributes

Body

[(ngModel)]="$binding$"$END$

Parameters

  • binding - no macro
  • END - The caret position after the template is applied.

Scope Angular 2 HTML attributes

Body

[routerLink]="['$routeName$']"$END$

Parameters

  • routeName - no macro
  • END - The caret position after the template is applied.
ngStyle

Scope Angular 2 HTML attributes

Body

[ngStyle]="{'$style$': $expression$}"$END$

Parameters

  • style - no macro
  • expression - no macro
  • END - The caret position after the template is applied.
Last modified: 20 August 2018