Skip to content

Commit 6bd841e

Browse files
committed
added html and typescript snippets
1 parent 0d18198 commit 6bd841e

File tree

5 files changed

+173
-55
lines changed

5 files changed

+173
-55
lines changed

CHANGELOG.md

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,28 @@
1+
<a name="7.0.0"></a>
2+
3+
# 7.0.0 (2018-12-08)
4+
5+
* Updated documentation to [`README.md`](https://github.com/hardikpthv/vscode-ng-material-snippets/blob/master/README.md) for new snippets
6+
* Added HTML snippets for
7+
* `matRipple` directive
8+
* `matRippleColor` directive
9+
* `<mat-horizontal-stepper>` control
10+
* `<mat-step>` control
11+
* `<mat-tree>` control
12+
* `<mat-tree-node>` control
13+
* `<mat-nested-tree-node>` control
14+
* `<mat-chip-list>` control
15+
* `<mat-chip>` control
16+
* Added TypeScript snippets for
17+
* `MatSnackBar` configuration
18+
119
<a name="6.1.0"></a>
220

321
# 6.1.0 (2018-09-22)
422

5-
* Added documentation to `README.md` for new snippets
23+
* Added documentation to [`README.md`](https://github.com/hardikpthv/vscode-ng-material-snippets/blob/master/README.md) for new snippets
624
* Added issues and homepage url to `package.json`
725
* Added HTML snippets for
8-
926
* `<mat-card>` control, no header, body and actions
1027
* `<mat-checkbox>` control with `formControlName`
1128
* `matInput` with `formControlName` enclosed `<mat-form-field>`
@@ -15,9 +32,7 @@
1532
* `<mat-selection-list>` control with default `<mat-list-option>`
1633
* `<mat-list-option>` single item
1734
* `<mat-list>` with default `<mat-icon matListIcon>`
18-
1935
* Fixed HTML snippets for
20-
2136
* added `role` in `a-md-auto-complete` for accessibility support
2237
* added projection for title to `a-md-badge-button`
2338
* added placeholder projection in `a-md-input-icon`
@@ -28,16 +43,13 @@
2843
* updated formatting for `a-md-sidenav`
2944
* removed unnecessary items from `a-md-menu-with-icon`
3045

31-
32-
3346
<a name="6.0.0"></a>
3447

3548
# 6.0.0 (2018-05-26)
3649

3750
* Added documentation to `README.md` for new snippets
3851
* Updated the `README.md` for v6
3952
* Added HTML snippets for
40-
4153
* `mat-badge` directive
4254
* `mat-button` directive
4355
* `mat-raised-button` directive
@@ -46,7 +58,6 @@
4658
* `mat-mini-fab` directive
4759
* `<mat-button-toggle-group>` control
4860
* `<mat-divider>` control
49-
5061
* Fixed HTML snippets for
5162
* `a-md-sel-opt` to `a-md-select-option`
5263

@@ -58,8 +69,8 @@
5869

5970
* `<mat-option>` control for `<mat-select>`
6071
* `<mat-radio-button>` control
61-
6272
* Fixed HTML snippets for
73+
6374
* `<mat-select>` with/without `ngModel`
6475
* `<mat-select>` placeholder
6576
* `matInput` placeholder
@@ -73,8 +84,8 @@
7384
* `<mat-error>` control for `matInput`
7485
* `matInput` directive
7586
* `matInput` with icon
76-
7787
* Fixed HTML snippets for
88+
7889
* `matInput` with/without `ngModel`
7990

8091
<a name="1.0.2"></a>
@@ -88,6 +99,7 @@
8899
# 1.0.1 (2017-10-19)
89100

90101
* Fixed tab sequence in HTML snippets for
102+
91103
* `<mat-autocomplete>` control
92104
* `<mat-card>` control
93105

@@ -96,6 +108,7 @@
96108
# 1.0.0 (2017-10-14)
97109

98110
* Added HTML snippets for
111+
99112
* `<mat-expansion-panel>` control
100113
* `<mat-grid-list>` control
101114
* `<mat-grid-tile>` control

README.md

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1-
# Angular Material v6 Snippets for VS Code
1+
# Angular Material v7 Snippets for VS Code
22

33
[![Version](https://vsmarketplacebadge.apphb.com/version/hardikpthv.AngularMaterial.svg)](https://marketplace.visualstudio.com/items?itemName=hardikpthv.AngularMaterial)
44
[![Install](https://vsmarketplacebadge.apphb.com/installs/hardikpthv.AngularMaterial.svg)](https://marketplace.visualstudio.com/items?itemName=hardikpthv.AngularMaterial)
55
[![Ratings](https://vsmarketplacebadge.apphb.com/rating-short/hardikpthv.AngularMaterial.svg)](https://marketplace.visualstudio.com/items?itemName=hardikpthv.AngularMaterial)
66
[![made-for-VSCode](https://img.shields.io/badge/Made%20for-VSCode-1f425f.svg)](https://code.visualstudio.com/)
77

8-
9-
This extension for Visual Studio Code adds snippets of HTML for Angular Material.
8+
This extension for Visual Studio Code adds snippets of HTML and TypeScript for Angular Material.
109

1110
Have a look at [CHANGELOG](CHANGELOG.md) for the latest changes
1211

@@ -16,7 +15,7 @@ Have a look at [CHANGELOG](CHANGELOG.md) for the latest changes
1615
1. Launch VS Code
1716
1. Hit `Cmd`-`Shift`-`P` (macOS) or `Ctrl`-`Shift`-`P` (Windows, Linux)
1817
1. Select `Install Extension`
19-
1. Choose the extension `Angular Material v2 snippets`
18+
1. Choose the extension `Angular Material v7 snippets`
2019
1. Reload Visual Studio Code
2120

2221
## Usage
@@ -41,6 +40,8 @@ Start typing `a-md-*` and hit `enter`, the snippet spreads out.
4140
| a-md-card-simple | `<mat-card>` control simple card |
4241
| a-md-checkbox | `<mat-checkbox>` control with `ngModel` |
4342
| a-md-checkbox-fc | `<mat-checkbox>` control with `formControlName` |
43+
| a-md-chips | `<mat-chip-list>` control with `<mat-chip>` |
44+
| a-md-chip | `<mat-chip>` control for `<mat-chip-list>` |
4445
| a-md-datepicker | `<mat-datepicker>` control |
4546
| a-md-divider | `<mat-divider>` control |
4647
| a-md-inset-divider | `<mat-divider>` control configured `inset` |
@@ -67,18 +68,31 @@ Start typing `a-md-*` and hit `enter`, the snippet spreads out.
6768
| a-md-progress-spinner | `<mat-progress-spinner>` control with `indeterminate` mode |
6869
| a-md-radio | `<mat-radio-group>` control with default `<mat-radio-button>` |
6970
| a-md-radio-btn | `<mat-radio-button>` button |
71+
| a-md-ripple | `matRipple` and `matRippleColor` directives |
72+
| a-md-ripple-container | Ripple container |
7073
| a-md-select | `<mat-select>` control |
7174
| a-md-select-fc | `<mat-select>` control with `formControlName` |
7275
| a-md-select-ngModel | `<mat-select>` control with `ngModel` |
7376
| a-md-select-option | `<mat-option>` for `<mat-select>` |
7477
| a-md-slider | `<mat-slider>` control default horizontal |
7578
| a-md-slider-vertical | `<mat-slider>` control vertical |
7679
| a-md-sidenav | `<mat-sidenav>` control with `*ngFor` to iterate through nav items |
80+
| a-md-stepper | `<mat-horizontal-stepper>` control with `<mat-step>` |
81+
| a-md-step | `<mat-step>` control with `<form>` |
7782
| a-md-switch | `<mat-slide-toggle>` switch control |
7883
| a-md-tab | `<mat-tab>` control with set of two tabs |
7984
| a-md-toolbar | `<mat-toolbar>` control with primary color as default |
8085
| a-md-tooltip | `matTooltip` directive to display tooltip |
8186
| a-md-tooltip-position | `matTooltipPosition` directive to set position |
87+
| a-md-tree | `<mat-tree>` control |
88+
| a-md-tree-node | `<mat-tree-node>` control |
89+
| a-md-tree-nested-node | `<mat-nested-tree-node>` control |
90+
91+
### TypeScript Snippets
92+
93+
| Snippet | Purpose |
94+
| ------------- | --------------------------- |
95+
| a-md-snackbar | `MatSnackBar` configuration |
8296

8397
### Using NgRx in Angular Apps
8498

package.json

Lines changed: 45 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,46 @@
11
{
2-
"name": "AngularMaterial",
3-
"displayName": "Angular Material v6 snippets",
4-
"description": "Angular Material with HTML snippets",
5-
"version": "6.1.0",
6-
"publisher": "hardikpthv",
7-
"license": "MIT",
8-
"icon": "images/angular.png",
9-
"galleryBanner": {
10-
"color": "#3f51b5",
11-
"theme": "dark"
12-
},
13-
"homepage": "https://github.com/hardikpthv/vscode-ng-material-snippets/blob/master/README.md",
14-
"bugs": {
15-
"url": "https://github.com/hardikpthv/vscode-ng-material-snippets/issues"
16-
},
17-
"repository": {
18-
"type": "git",
19-
"url": "https://github.com/hardikpthv/vscode-ng-material-snippets.git"
20-
},
21-
"keywords": [
22-
"Angular",
23-
"Angular 6",
24-
"Material",
25-
"Angular Material",
26-
"HTML"
27-
],
28-
"engines": {
29-
"vscode": "^1.10.0"
30-
},
31-
"categories": [
32-
"Snippets"
33-
],
34-
"contributes": {
35-
"snippets": [
36-
{
37-
"language": "html",
38-
"path": "./snippets/html.json"
39-
}
40-
]
41-
}
42-
}
2+
"name": "AngularMaterial",
3+
"displayName": "Angular Material v7 snippets",
4+
"description": "Angular Material with HTML snippets",
5+
"version": "7.0.0",
6+
"publisher": "hardikpthv",
7+
"license": "MIT",
8+
"icon": "images/angular.png",
9+
"galleryBanner": {
10+
"color": "#3f51b5",
11+
"theme": "dark"
12+
},
13+
"homepage": "https://github.com/hardikpthv/vscode-ng-material-snippets/blob/master/README.md",
14+
"bugs": {
15+
"url": "https://github.com/hardikpthv/vscode-ng-material-snippets/issues"
16+
},
17+
"repository": {
18+
"type": "git",
19+
"url": "https://github.com/hardikpthv/vscode-ng-material-snippets.git"
20+
},
21+
"keywords": [
22+
"Angular",
23+
"Angular 6",
24+
"Material",
25+
"Angular Material",
26+
"HTML"
27+
],
28+
"engines": {
29+
"vscode": "^1.10.0"
30+
},
31+
"categories": [
32+
"Snippets"
33+
],
34+
"contributes": {
35+
"snippets": [
36+
{
37+
"language": "html",
38+
"path": "./snippets/html.json"
39+
},
40+
{
41+
"language": "typescript",
42+
"path": "./snippets/typescript.json"
43+
}
44+
]
45+
}
46+
}

snippets/html.json

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -442,5 +442,77 @@
442442
"</mat-list>"
443443
],
444444
"description": "<mat-list> control with icon"
445+
},
446+
"matRipple": {
447+
"prefix": "a-md-ripple",
448+
"body": ["matRipple [matRippleColor]=\"${1:color}\""],
449+
"description": "matRipple and matRippleColor directives"
450+
},
451+
"matRippleContainer": {
452+
"prefix": "a-md-ripple-container",
453+
"body": ["<div matRipple [matRippleColor]=\"${1:color}\">", "\t", "</div>"],
454+
"description": "Ripple container"
455+
},
456+
"matHorizontalStepper": {
457+
"prefix": "a-md-stepper",
458+
"body": [
459+
"<mat-horizontal-stepper [linear]=\"${1:isLinear}\" #stepper>",
460+
"\t<mat-step [stepControl]=\"${2:formGroup}\">",
461+
"\t\t<form></form>",
462+
"\t\t<div>",
463+
"\t\t\t<button mat-button matStepperNext>Next</button>",
464+
"\t\t</div>",
465+
"\t</mat-step>",
466+
"</mat-horizontal-stepper>"
467+
],
468+
"description": "<mat-horizontal-stepper> control"
469+
},
470+
"matHorizontalStep": {
471+
"prefix": "a-md-step",
472+
"body": [
473+
"<mat-step [stepControl]=\"${1:formGroup}\">",
474+
"\t<form></form>",
475+
"\t<div>",
476+
"\t\t<button mat-button matStepperPrevious>Back</button>",
477+
"\t\t<button mat-button matStepperNext>Next</button>",
478+
"\t</div>",
479+
"</mat-step>"
480+
],
481+
"description": "<mat-step> control"
482+
},
483+
"matTree": {
484+
"prefix": "a-md-tree",
485+
"body": [
486+
"<mat-tree>",
487+
"\t<mat-tree-node>${1:parent}</mat-tree-node>",
488+
"\t<mat-tree-node> -- ${2:child}</mat-tree-node>",
489+
"</mat-tree>"
490+
],
491+
"description": "<mat-tree> control"
492+
},
493+
"matTreeNode": {
494+
"prefix": "a-md-tree-node",
495+
"body": ["<mat-tree-node>${1:value}</mat-tree-node>"],
496+
"description": "<mat-tree-node> control"
497+
},
498+
"matTreeNestedNode": {
499+
"prefix": "a-md-tree-nested-node",
500+
"body": ["<mat-nested-tree-node>${1:value}</mat-nested-tree-node>"],
501+
"description": "<mat-nested-tree-node> control"
502+
},
503+
"matChips": {
504+
"prefix": "a-md-chips",
505+
"body": [
506+
"<mat-chip-list>",
507+
"\t<mat-chip>${1:val1}</mat-chip>",
508+
"\t<mat-chip>${2:val2}</mat-chip>",
509+
"</mat-chip-list>"
510+
],
511+
"description": "<mat-chip-list> control with <mat-chip>"
512+
},
513+
"matChip": {
514+
"prefix": "a-md-chip",
515+
"body": ["<mat-chip>${1:val}</mat-chip>"],
516+
"description": "<mat-chip> control for <mat-chip-list>"
445517
}
446518
}

snippets/typescript.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"matAutoComplete": {
3+
"prefix": "a-md-snackbar",
4+
"body": [
5+
"//import {MatSnackBar} from '@angular/material';",
6+
"//constructor(public snackBar: MatSnackBar) {}",
7+
"openSnackBar(message: string, action: string) {",
8+
"\tthis.snackBar.open(message, action, {",
9+
"\t\tduration: ${1:duration},",
10+
"\t});",
11+
"}"
12+
],
13+
"description": "MatSnackBar configuration"
14+
}
15+
}

0 commit comments

Comments
 (0)