https://github.com/Chris2011/netbeans-angular2-code-templates
Code templates for Angular 2 in Netbeans. Templates exists for TypeScript and HTML.
https://github.com/Chris2011/netbeans-angular2-code-templates
Last synced: 5 months ago
JSON representation
Code templates for Angular 2 in Netbeans. Templates exists for TypeScript and HTML.
- Host: GitHub
- URL: https://github.com/Chris2011/netbeans-angular2-code-templates
- Owner: Chris2011
- License: mit
- Created: 2016-05-09T13:05:19.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-10-27T14:38:58.000Z (about 8 years ago)
- Last Synced: 2025-06-12T08:45:48.697Z (5 months ago)
- Size: 217 KB
- Stars: 7
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-netbeans - NetBeans Angular2 Code Templates - Code Templates for Angular 2+ projects. (:electric_plug: Plugins <a name="plugins"></a> / Language Support)
README
Angular TypeScript Snippets for NetBeans
Now Updated for Angular 4.3.0 release
Biggest change
Now I use camelCase, because NetBeans has a problem when you type a-.
The code completion will disappear. So this will not happen with camelCase.
Now I use a or aNg and rx as a prefix, to be faster while typing.
It is based on the Visual Studio Code implementation: https://github.com/johnpapa/vscode-angular2-snippets
This extension for NetBeans adds snippets for Angular for TypeScript and HTML.
TypeScript (old screenshot)
HTML (old screenshot)
Usage
Type part of a snippet, press enter or tab, and the snippet unfolds.
TypeScript Angular Snippets
-
aComponent - component
-
aComponentInline - component with inline template
-
aComponentRoot - root app component
-
aDirective - directive
-
aGuardCanActive - CanActivate guard
-
aGuardCanActiveChild - CanActivateChild guard
-
aGuardCanDeactivate - CanDeactivate guard
-
aHttpGet - http.get with Rx Observable
-
aHttpclientGet - httpClient.get with Rx Observable
-
aHttpInterceptor - Empty Angular HttpInterceptor for HttpClient
-
aHttpInterceptorHeaders - Angular HttpInterceptor that sets headers for HttpClient
-
aHttpInterceptorLogging - Angular HttpInterceptor that logs traffic for HttpClient
-
aModule - module
-
aModuleRoot - root app module
-
aModuleRouting - routing module file (forChild)
-
aOutputEvent - @Output event and emitter
-
aPipe - pipe
-
aRoutePath404 - 404 route path
-
aRoutePathDefault - default route path
-
aRoutePathEager - eager route path
-
aRoutePathLazy - lazy route path
-
aRouterEvents - listen to one or more router events
-
aService - service
-
aServiceHttp - service with Http
-
aServiceHttpclient - service with HttpClient
-
aCtorSkipSelf - angular NgModule's skipself constructor
-
aSubscribe - Rx Observable subscription
-
aResolver - resolver
TypeScript RxJS Snippets
-
rxObservable - Rx Observable import
-
rxSubject - Rx Subject import
-
rxReplaySubject - Rx ReplaySubject import
-
rxBehaviorSubject - Rx BehaviorSubject import
-
rxAddOperator - Rx add operator import
-
rxAddObservable - Rx add observable import
HTML Snippets
-
aClass - [class] binding
-
aNgClass - ngClass
-
aNgContainer - <ng-container> element
-
aNgContent - <ng-content> element
-
aNgFor - *ngFor
-
aNgForAsync - *ngFor with async
-
aNgForTrackBy - *ngFor with trackBy
-
aNgIf - *ngIf
-
aNgIfElse - *ngIf with else
-
aNgModel - ngModel
-
aNgStyle - ngStyle
-
aNgSwitch - ngSwitch
-
aNgTemplate - <ng-template> element
-
aPrej - show the JSON form of a model
-
aPreja - show the JSON form of a model, using async
-
aRouterLink - routerLink
-
aRouterLinkParam - routerLink with a route parameter
-
aSelect - <select> control
-
aStyle - [style] binding
How to install
Install the plugin.
Test it into a TypeScript or HTML file (Examples: typescript shortcut aPipe + TAB => import { Pipe, PipeTransform..., html shortcut aNgSwitch + TAB => <div [ngSwitch]=...", ...)
Known Bugs
HTML code completion doesn't include the code templates, but the code templates are working well. A Ticket was created: https://netbeans.org/bugzilla/show_bug.cgi?id=250321