261 lines
No EOL
28 KiB
XML
261 lines
No EOL
28 KiB
XML
<templateSet group="Angular">
|
|
<template name="a-class" value="[class]="$expression$"" description="Angular [class] binding" toReformat="true" toShortenFQNames="true">
|
|
<variable name="expression" expression="" defaultValue=""expression"" alwaysStopAt="true" />
|
|
<context />
|
|
</template>
|
|
<template name="a-ngClass" value="[ngClass]="{$cssClass$: $expression$}"" description="Angular ngClass" toReformat="true" toShortenFQNames="true">
|
|
<variable name="cssClass" expression="" defaultValue=""cssClass"" alwaysStopAt="true" />
|
|
<variable name="expression" expression="" defaultValue=""expression"" alwaysStopAt="true" />
|
|
<context />
|
|
</template>
|
|
<template name="a-ngFor" value="*ngFor="let $item$ of $list$"$END$" description="Angular *ngFor" toReformat="true" toShortenFQNames="true">
|
|
<variable name="item" expression="" defaultValue=""item"" alwaysStopAt="true" />
|
|
<variable name="list" expression="" defaultValue=""list"" alwaysStopAt="true" />
|
|
<context />
|
|
</template>
|
|
<template name="a-ngFor-trackBy" value="*ngFor="let $item$ of $list$; trackBy:$item$.id"$END$" description="Angular *ngFor with trackBy" toReformat="true" toShortenFQNames="true">
|
|
<variable name="item" expression="" defaultValue=""item"" alwaysStopAt="true" />
|
|
<variable name="list" expression="" defaultValue=""list"" alwaysStopAt="true" />
|
|
<context />
|
|
</template>
|
|
<template name="a-ngForAsync" value="*ngFor="let $item$ of $stream$ | async as $list$"$END$" description="Angular *ngForAsync" toReformat="true" toShortenFQNames="true">
|
|
<variable name="item" expression="" defaultValue=""item"" alwaysStopAt="true" />
|
|
<variable name="stream" expression="" defaultValue=""stream"" alwaysStopAt="true" />
|
|
<variable name="list" expression="" defaultValue=""list"" alwaysStopAt="true" />
|
|
<context />
|
|
</template>
|
|
<template name="a-formControlName" value="formControlName="$control$"" description="Angular formControlName" toReformat="true" toShortenFQNames="true">
|
|
<variable name="control" expression="" defaultValue=""control"" alwaysStopAt="true" />
|
|
<context />
|
|
</template>
|
|
<template name="a-formGroup" value="[formGroup]="$form$"" description="Angular formGroup" toReformat="true" toShortenFQNames="true">
|
|
<variable name="form" expression="" defaultValue=""form"" alwaysStopAt="true" />
|
|
<context />
|
|
</template>
|
|
<template name="a-formGroupName" value="[formGroupName]="$name$"" description="Angular formGroupName" toReformat="true" toShortenFQNames="true">
|
|
<variable name="name" expression="" defaultValue=""name"" alwaysStopAt="true" />
|
|
<context />
|
|
</template>
|
|
<template name="a-ngIf" value="*ngIf="$expression$"" description="Angular *ngIf" toReformat="true" toShortenFQNames="true">
|
|
<variable name="expression" expression="" defaultValue=""expression"" alwaysStopAt="true" />
|
|
<context />
|
|
</template>
|
|
<template name="a-ngIfElse" value="*ngIf="$expression$;else $templateName$"" description="Angular *ngIfElse" toReformat="true" toShortenFQNames="true">
|
|
<variable name="expression" expression="" defaultValue=""expression"" alwaysStopAt="true" />
|
|
<variable name="templateName" expression="" defaultValue=""templateName"" alwaysStopAt="true" />
|
|
<context />
|
|
</template>
|
|
<template name="a-ngModel" value="[(ngModel)]="$binding$"" description="Angular ngModel" toReformat="true" toShortenFQNames="true">
|
|
<variable name="binding" expression="" defaultValue=""binding"" alwaysStopAt="true" />
|
|
<context />
|
|
</template>
|
|
<template name="a-routerLink" value="[routerLink]="['/$routePath$']" routerLinkActive="$router_link-active$" $END$" description="Angular routerLink" toReformat="true" toShortenFQNames="true">
|
|
<variable name="routePath" expression="" defaultValue=""routePath"" alwaysStopAt="true" />
|
|
<variable name="router_link-active" expression="" defaultValue=""router-link-active"" alwaysStopAt="true" />
|
|
<context />
|
|
</template>
|
|
<template name="a-routerLink-param" value="[routerLink]="['$routePath$', $routeParameterValue$]" routerLinkActive="$router_link-active$"$END$" description="Angular routerLink with a route parameter" toReformat="true" toShortenFQNames="true">
|
|
<variable name="routePath" expression="" defaultValue=""routePath"" alwaysStopAt="true" />
|
|
<variable name="routeParameterValue" expression="" defaultValue=""routeParameterValue"" alwaysStopAt="true" />
|
|
<variable name="router_link-active" expression="" defaultValue=""router-link-active"" alwaysStopAt="true" />
|
|
<context />
|
|
</template>
|
|
<template name="a-select" value="<select [(ngModel)]="$model$"> <option *ngFor="let $item$ of $list$" [value]="$item$">{{$item$}}</option> </select>" description="<select> control with ngModel" toReformat="true" toShortenFQNames="true">
|
|
<variable name="model" expression="" defaultValue=""model"" alwaysStopAt="true" />
|
|
<variable name="item" expression="" defaultValue=""item"" alwaysStopAt="true" />
|
|
<variable name="list" expression="" defaultValue=""list"" alwaysStopAt="true" />
|
|
<context />
|
|
</template>
|
|
<template name="a-ngStyle" value="[ngStyle]="{$style$: $expression$}"" description="Angular ngStyle" toReformat="true" toShortenFQNames="true">
|
|
<variable name="style" expression="" defaultValue=""style"" alwaysStopAt="true" />
|
|
<variable name="expression" expression="" defaultValue=""expression"" alwaysStopAt="true" />
|
|
<context />
|
|
</template>
|
|
<template name="a-ngSwitch" value="<div [ngSwitch]="$conditionExpression$"> <div *ngSwitchCase="$expression$">$output$</div> <div *ngSwitchDefault>$output2$</div> </div>" description="Angular ngSwitch" toReformat="true" toShortenFQNames="true">
|
|
<variable name="conditionExpression" expression="" defaultValue=""conditionExpression"" alwaysStopAt="true" />
|
|
<variable name="expression" expression="" defaultValue=""expression"" alwaysStopAt="true" />
|
|
<variable name="output" expression="" defaultValue=""output"" alwaysStopAt="true" />
|
|
<variable name="output2" expression="" defaultValue=""output2"" alwaysStopAt="true" />
|
|
<context />
|
|
</template>
|
|
<template name="a-preja" value="<pre>{{$model$ | async | json}}</pre>$END$" description="Angular pre debug | async | json" toReformat="true" toShortenFQNames="true">
|
|
<variable name="model" expression="" defaultValue=""model"" alwaysStopAt="true" />
|
|
<context />
|
|
</template>
|
|
<template name="a-prej" value="<pre>{{$model$ | json}}</pre>$END$" description="Angular pre debug | json" toReformat="true" toShortenFQNames="true">
|
|
<variable name="model" expression="" defaultValue=""model"" alwaysStopAt="true" />
|
|
<context />
|
|
</template>
|
|
<template name="a-style" value="[style.$property$]="$expression$"" description="Angular [style] binding" toReformat="true" toShortenFQNames="true">
|
|
<variable name="property" expression="" defaultValue=""property"" alwaysStopAt="true" />
|
|
<variable name="expression" expression="" defaultValue=""expression"" alwaysStopAt="true" />
|
|
<context />
|
|
</template>
|
|
<template name="a-route-path-404" value="{ path: '**', component: $PathNotFoundComponent$ }$END$" description="Angular 404 route path" toReformat="true" toShortenFQNames="true">
|
|
<variable name="PathNotFoundComponent" expression="" defaultValue=""PathNotFoundComponent"" alwaysStopAt="true" />
|
|
<context />
|
|
</template>
|
|
<template name="a-guard-can-activate" value="import { Injectable } from '@angular/core'; import { ActivatedRouteSnapshot, CanActivate, RouterStateSnapshot } from '@angular/router'; @Injectable({providedIn: $2$}) export class $Name$Guard implements CanActivate { constructor() { } canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot) { return true;$END$ } }" description="Angular CanActivate guard" toReformat="true" toShortenFQNames="true">
|
|
<variable name="2" expression="" defaultValue=""'root'"" alwaysStopAt="true" />
|
|
<variable name="Name" expression="" defaultValue=""Name"" alwaysStopAt="true" />
|
|
<context />
|
|
</template>
|
|
<template name="a-guard-can-activate-child" value="import { Injectable } from '@angular/core'; import { ActivatedRouteSnapshot, CanActivateChild, RouterStateSnapshot } from '@angular/router'; @Injectable({providedIn: $2$}) export class $Name$Guard implements CanActivateChild { constructor() { } canActivateChild(route: ActivatedRouteSnapshot, state: RouterStateSnapshot) { return true;$END$ } }" description="Angular CanActivateChild guard" toReformat="true" toShortenFQNames="true">
|
|
<variable name="2" expression="" defaultValue=""'root'"" alwaysStopAt="true" />
|
|
<variable name="Name" expression="" defaultValue=""Name"" alwaysStopAt="true" />
|
|
<context />
|
|
</template>
|
|
<template name="a-guard-can-deactivate" value="import { Injectable } from '@angular/core'; import { ActivatedRouteSnapshot, CanDeactivate, RouterStateSnapshot } from '@angular/router'; import { Observable } from 'rxjs'; import { $ComponentName$Component } from './$filename$.component'; // Consider using this interface for all CanDeactivate guards, // and have your components implement this interface, too. // // e.g. export class CanDeactivateGuard implements CanDeactivate<CanComponentDeactivate> { // // export interface CanComponentDeactivate { // canDeactivate: () => any; // } @Injectable({providedIn: $4$}) export class $Name$Guard implements CanDeactivate<$ComponentName$Component> { canDeactivate( component: $ComponentName$Component, currentRoute: ActivatedRouteSnapshot, currentState: RouterStateSnapshot ): Observable<boolean>|Promise<boolean>|boolean { return false;$END$ } }" description="Angular CanDeactivate guard" toReformat="true" toShortenFQNames="true">
|
|
<variable name="4" expression="" defaultValue=""'root'"" alwaysStopAt="true" />
|
|
<variable name="ComponentName" expression="" defaultValue=""ComponentName"" alwaysStopAt="true" />
|
|
<variable name="filename" expression="lowercaseAndDash(ComponentName)" defaultValue="" alwaysStopAt="true" />
|
|
<variable name="Name" expression="" defaultValue=""Name"" alwaysStopAt="true" />
|
|
<context />
|
|
</template>
|
|
<template name="a-guard-can-load" value="import { Injectable } from '@angular/core'; import { CanLoad, Route } from '@angular/router'; @Injectable({providedIn: $2$}) export class $Name$Guard implements CanLoad { constructor() { } canLoad(route: Route) { return true;$END$ } }" description="Angular CanLoad guard" toReformat="true" toShortenFQNames="true">
|
|
<variable name="2" expression="" defaultValue=""'root'"" alwaysStopAt="true" />
|
|
<variable name="Name" expression="" defaultValue=""Name"" alwaysStopAt="true" />
|
|
<context />
|
|
</template>
|
|
<template name="a-component" value="import { Component, OnInit } from '@angular/core'; @Component({ selector: '$selector_name$', templateUrl: '$name$.component.html' }) export class $Name$Component implements OnInit { constructor() { } ngOnInit() { }$END$ }" description="Angular component" toReformat="true" toShortenFQNames="true">
|
|
<variable name="Name" expression="" defaultValue=""Name"" alwaysStopAt="true" />
|
|
<variable name="name" expression="lowercaseAndDash(Name)" defaultValue="" alwaysStopAt="true" />
|
|
<variable name="selector_name" expression="lowercaseAndDash(Name)" defaultValue="" alwaysStopAt="true" />
|
|
<context />
|
|
</template>
|
|
<template name="a-component-inline" value="import { Component, OnInit } from '@angular/core'; @Component({ selector: '$selector_name$', template: `$END$` }) export class $Name$Component implements OnInit { constructor() { } ngOnInit() { } }" description="Angular component with an inline template" toReformat="true" toShortenFQNames="true">
|
|
<variable name="Name" expression="" defaultValue=""Name"" alwaysStopAt="true" />
|
|
<variable name="selector_name" expression="lowercaseAndDash(Name)" defaultValue="" alwaysStopAt="true" />
|
|
<context />
|
|
</template>
|
|
<template name="a-preload-strategy" value="import { PreloadingStrategy, Route } from '@angular/router'; import { Observable, of } from 'rxjs'; export class PreloadSelectedModulesList implements PreloadingStrategy { preload(route: Route, load: Function): Observable<any> { return route.data && route.data['$preload$'] ? load() : of(null); } } $END$" description="Angular custom preload strategy" toReformat="true" toShortenFQNames="true">
|
|
<variable name="preload" expression="" defaultValue=""preload"" alwaysStopAt="true" />
|
|
<context />
|
|
</template>
|
|
<template name="a-route-path-default" value="{ path: '', pathMatch: 'full', redirectTo: '$path$' }$END$" description="Angular default route path" toReformat="true" toShortenFQNames="true">
|
|
<variable name="path" expression="" defaultValue=""path"" alwaysStopAt="true" />
|
|
<context />
|
|
</template>
|
|
<template name="a-directive" value="import { Directive } from '@angular/core'; @Directive({ selector: '[$selector_name$]' }) export class $Name$Directive { constructor() { } }" description="Angular directive" toReformat="true" toShortenFQNames="true">
|
|
<variable name="Name" expression="" defaultValue=""Name"" alwaysStopAt="true" />
|
|
<variable name="selector_name" expression="lowercaseAndDash(Name)" defaultValue="" alwaysStopAt="true" />
|
|
<context />
|
|
</template>
|
|
<template name="a-route-path-eager" value="{ path: '$path$', component: $Name$Component }," description="Angular eager route path" toReformat="true" toShortenFQNames="true">
|
|
<variable name="path" expression="" defaultValue=""path"" alwaysStopAt="true" />
|
|
<variable name="Name" expression="" defaultValue=""Name"" alwaysStopAt="true" />
|
|
<context />
|
|
</template>
|
|
<template name="a-service-httpclient" value="import { Injectable } from '@angular/core'; import { HttpClient } from '@angular/common/http'; @Injectable({providedIn: $2$}) export class $ServiceName$Service { constructor(private httpClient: HttpClient) { } $END$ }" description="Angular service with HttpClient" toReformat="true" toShortenFQNames="true">
|
|
<variable name="2" expression="" defaultValue=""'root'"" alwaysStopAt="true" />
|
|
<variable name="ServiceName" expression="" defaultValue=""ServiceName"" alwaysStopAt="true" />
|
|
<context />
|
|
</template>
|
|
<template name="a-http-interceptor" value="import { Injectable } from '@angular/core'; import { HttpInterceptor, HttpEvent, HttpHandler, HttpRequest } from '@angular/common/http'; import { Observable } from 'rxjs'; @Injectable({providedIn: $1$}) export class HeaderInterceptor implements HttpInterceptor { intercept(req: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> { return next.handle(req); } }" description="Empty Angular HttpInterceptor for HttpClient" toReformat="true" toShortenFQNames="true">
|
|
<variable name="1" expression="" defaultValue=""'root'"" alwaysStopAt="true" />
|
|
<context />
|
|
</template>
|
|
<template name="a-http-interceptor-headers" value="import { Injectable } from '@angular/core'; import { HttpEvent, HttpInterceptor, HttpHandler, HttpRequest } from '@angular/common/http'; import { Observable } from 'rxjs'; @Injectable({providedIn: $1$}) export class HeaderInterceptor implements HttpInterceptor { constructor() {} intercept(req: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> { const headers = req.headers .set('Content-Type', 'application/json'); const authReq = req.clone({ headers }); return next.handle(authReq); } }" description="Angular HttpInterceptor for headers HttpClient" toReformat="true" toShortenFQNames="true">
|
|
<variable name="1" expression="" defaultValue=""'root'"" alwaysStopAt="true" />
|
|
<context />
|
|
</template>
|
|
<template name="a-http-interceptor-logging" value="import { HttpInterceptor, HttpHandler, HttpRequest, HttpEvent, HttpResponse } from '@angular/common/http'; import { Observable, tap } from 'rxjs'; @Injectable({providedIn: $1$}) export class LogInterceptor implements HttpInterceptor { constructor() {} intercept(req: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> { const started = Date.now(); return next.handle(req).pipe( tap(event => { if (event instanceof HttpResponse) { const elapsed = Date.now() - started; console.log(`Request for \${req.urlWithParams} took \$elapsed$ ms.`); } }) ); } }" description="Angular HttpInterceptor for Logging HttpClient" toReformat="true" toShortenFQNames="true">
|
|
<variable name="1" expression="" defaultValue=""'root'"" alwaysStopAt="true" />
|
|
<variable name="elapsed" expression="" defaultValue="""" alwaysStopAt="true" />
|
|
<context />
|
|
</template>
|
|
<template name="a-route-path-lazy" value="{ path: '$path$', loadChildren: '$lazy_path$#$lazy_module$' }," description="Angular lazy route path" toReformat="true" toShortenFQNames="true">
|
|
<variable name="path" expression="" defaultValue=""path"" alwaysStopAt="true" />
|
|
<variable name="lazy_path" expression="" defaultValue=""lazy-path"" alwaysStopAt="true" />
|
|
<variable name="lazy_module" expression="" defaultValue=""lazy-module"" alwaysStopAt="true" />
|
|
<context />
|
|
</template>
|
|
<template name="a-module" value="import { NgModule } from '@angular/core'; import { $Name$Component } from './$name$.component'; @NgModule({ imports: [], exports: [], declarations: [$Name$Component], providers: [], }) export class $Name$Module { } $END$" description="Angular Module" toReformat="true" toShortenFQNames="true">
|
|
<variable name="Name" expression="" defaultValue=""Name"" alwaysStopAt="true" />
|
|
<variable name="name" expression="lowercaseAndDash(Name)" defaultValue="" alwaysStopAt="true" />
|
|
<context />
|
|
</template>
|
|
<template name="a-ctor-skip-self" value="constructor( @Optional() @SkipSelf() parentModule: $ModuleName$ { if (parentModule) { const msg = `$ModuleName$ has already been loaded. Import $ModuleName$ once, only, in the root AppModule.`; throw new Error(msg); } }" description="Angular Module SkipSelf constructor" toReformat="true" toShortenFQNames="true">
|
|
<variable name="ModuleName" expression="" defaultValue=""ModuleName"" alwaysStopAt="true" />
|
|
<context />
|
|
</template>
|
|
<template name="a-module-with-routing" value="import { NgModule } from '@angular/core'; import { Routes, RouterModule } from '@angular/router'; const routes: Routes = [$END$] @NgModule({ imports: [RouterModule.$forChild$(routes)], exports: [], declarations: [], }) export class $Name$Module { }" description="Angular module with routing combined into one file" toReformat="true" toShortenFQNames="true">
|
|
<variable name="forChild" expression="" defaultValue=""forChild"" alwaysStopAt="true" />
|
|
<variable name="Name" expression="" defaultValue=""Name"" alwaysStopAt="true" />
|
|
<context />
|
|
</template>
|
|
<template name="a-pipe" value="import { Pipe, PipeTransform } from '@angular/core'; @Pipe({ name: '$selector_name$' }) export class $Name$Pipe implements PipeTransform { transform(value: any, ...args: any[]): any { $END$ } }" description="Angular pipe" toReformat="true" toShortenFQNames="true">
|
|
<variable name="Name" expression="" defaultValue=""Name"" alwaysStopAt="true" />
|
|
<variable name="selector_name" expression="lowercaseAndDash(Name)" defaultValue="" alwaysStopAt="true" />
|
|
<context />
|
|
</template>
|
|
<template name="a-injectable-providedin" value="@Injectable({providedIn: $1$})$END$" description="Angular Injectable ProvidedIn" toReformat="true" toShortenFQNames="true">
|
|
<variable name="1" expression="" defaultValue=""'root'"" alwaysStopAt="true" />
|
|
<context />
|
|
</template>
|
|
<template name="a-component-root" value="import { Component } from '@angular/core'; @Component({ selector: '$prefix_app$', template: ` <router-outlet></router-outlet> ` }) export class $App$Component { } $END$" description="Angular App root component" toReformat="true" toShortenFQNames="true">
|
|
<variable name="prefix_app" expression="" defaultValue=""prefix-app"" alwaysStopAt="true" />
|
|
<variable name="App" expression="" defaultValue=""App"" alwaysStopAt="true" />
|
|
<context />
|
|
</template>
|
|
<template name="a-module-root" value="import { NgModule } from '@angular/core'; import { BrowserModule } from '@angular/platform-browser'; import { HttpModule } from '@angular/http'; import { $App$Component } from './$app$.component'; @NgModule({ imports: [ BrowserModule, HttpModule, ], declarations: [$App$Component], bootstrap: [$App$Component], }) export class $App$Module { } $END$" description="Angular Root Module" toReformat="true" toShortenFQNames="true">
|
|
<variable name="App" expression="" defaultValue=""App"" alwaysStopAt="true" />
|
|
<variable name="app" expression="lowercaseAndDash(App)" defaultValue="" alwaysStopAt="true" />
|
|
<context />
|
|
</template>
|
|
<template name="a-route-path-with-children" value="{ path: '$path$', component: $Component$, children: [ { path: '$childpath$', component: $ChildComponent$ } ] }$END$" description="Angular route path with children" toReformat="true" toShortenFQNames="true">
|
|
<variable name="path" expression="" defaultValue=""path"" alwaysStopAt="true" />
|
|
<variable name="Component" expression="" defaultValue=""Component"" alwaysStopAt="true" />
|
|
<variable name="childpath" expression="" defaultValue=""childpath"" alwaysStopAt="true" />
|
|
<variable name="ChildComponent" expression="" defaultValue=""ChildComponent"" alwaysStopAt="true" />
|
|
<context />
|
|
</template>
|
|
<template name="a-router-events" value="checkEvents() { this.router.events.subscribe(event => { switch (true) { case event instanceof $eventName$: $END$ break; default: break; } }); }" description="Angular Router Events" toReformat="true" toShortenFQNames="true">
|
|
<variable name="eventName" expression="" defaultValue=""eventName"" alwaysStopAt="true" />
|
|
<context />
|
|
</template>
|
|
<template name="a-service" value="import { Injectable } from '@angular/core'; @Injectable() export class $Name$Service { $END$ constructor() { } }" description="Angular service" toReformat="true" toShortenFQNames="true">
|
|
<variable name="Name" expression="" defaultValue=""Name"" alwaysStopAt="true" />
|
|
<context />
|
|
</template>
|
|
<template name="a-httpclient-get" value="return this.httpClient.get('$url$');$END$" description="Angular HttpClient.get" toReformat="true" toShortenFQNames="true">
|
|
<variable name="url" expression="" defaultValue=""url"" alwaysStopAt="true" />
|
|
<context />
|
|
</template>
|
|
<template name="a-ngrx-data-entity-collection-data-service" value="import { Injectable } from '@angular/core'; import { EntityCollectionServiceBase, EntityCollectionServiceElementsFactory } from 'ngrx-data'; import { $Model$ } from '$2$'; @Injectable({ providedIn: 'root' }) export class $Model$Service extends EntityCollectionServiceBase<$Model$> { constructor(serviceElementsFactory: EntityCollectionServiceElementsFactory) { super('$Model$', serviceElementsFactory); } }" description="NgRx Data Entity Collection Data Service" toReformat="true" toShortenFQNames="true">
|
|
<variable name="2" expression="" defaultValue=""../core"" alwaysStopAt="true" />
|
|
<variable name="Model" expression="" defaultValue=""Model"" alwaysStopAt="true" />
|
|
<context />
|
|
</template>
|
|
<template name="a-ngrx-data-entity-metadata" value="import { EntityMetadataMap } from 'ngrx-data'; const entityMetadata: EntityMetadataMap = { $Model1$: {},$END$ }; export const entityConfig = { entityMetadata };" description="NgRx Data Entity Metadata" toReformat="true" toShortenFQNames="true">
|
|
<variable name="Model1" expression="" defaultValue=""Model1"" alwaysStopAt="true" />
|
|
<context />
|
|
</template>
|
|
<template name="a-ngrx-data-store-module" value="import { NgModule } from '@angular/core'; import { EffectsModule } from '@ngrx/effects'; import { StoreModule } from '@ngrx/store'; import { StoreDevtoolsModule } from '@ngrx/store-devtools'; import { NgrxDataModule } from 'ngrx-data'; import { environment } from '../../environments/environment'; import { entityConfig } from './entity-metadata'; @NgModule({ imports: [ StoreModule.forRoot({}), EffectsModule.forRoot([]), environment.production ? [] : StoreDevtoolsModule.instrument(), NgrxDataModule.forRoot(entityConfig) ] }) export class AppStoreModule {}" description="NgRx Data Store Module" toReformat="true" toShortenFQNames="true">
|
|
<context />
|
|
</template>
|
|
<template name="a-output-event" value="@Output() $eventName$ = new EventEmitter<$eventType$>();" description="Angular @Output event and emitter" toReformat="true" toShortenFQNames="true">
|
|
<variable name="eventName" expression="" defaultValue=""eventName"" alwaysStopAt="true" />
|
|
<variable name="eventType" expression="" defaultValue=""eventType"" alwaysStopAt="true" />
|
|
<context />
|
|
</template>
|
|
<template name="a-route-params-subscribe" value="this.route.params .pipe(map(params => params['id']), tap(id => (this.id = +id))) .subscribe(id => $1$()); $END$" description="Angular - subscribe to routing parameters" toReformat="true" toShortenFQNames="true">
|
|
<variable name="1" expression="" defaultValue=""function()"" alwaysStopAt="true" />
|
|
<context />
|
|
</template>
|
|
<template name="a-rxjs-import" value="import { $Observable$ } from 'rxjs'; $END$" description="RxJs import" toReformat="true" toShortenFQNames="true">
|
|
<variable name="Observable" expression="" defaultValue=""Observable"" alwaysStopAt="true" />
|
|
<context />
|
|
</template>
|
|
<template name="a-rxjs-operator-import" value="import { $map$ } from 'rxjs/operators'; $END$" description="RxJs import" toReformat="true" toShortenFQNames="true">
|
|
<variable name="map" expression="" defaultValue=""map"" alwaysStopAt="true" />
|
|
<context />
|
|
</template>
|
|
<template name="a-subscribe" value="this.$service$.$function$ .subscribe($arg$ => this.$property$ = $arg$); $END$" description="Angular observable subscribe" toReformat="true" toShortenFQNames="true">
|
|
<variable name="service" expression="" defaultValue=""service"" alwaysStopAt="true" />
|
|
<variable name="function" expression="" defaultValue=""function"" alwaysStopAt="true" />
|
|
<variable name="arg" expression="" defaultValue=""arg"" alwaysStopAt="true" />
|
|
<variable name="property" expression="" defaultValue=""property"" alwaysStopAt="true" />
|
|
<context />
|
|
</template>
|
|
</templateSet> |