Skip to content

Commit 799f4c2

Browse files
authored
Merge pull request #3 from hardikpthv/feat/support-v10
feat: add more snippets
2 parents 9d7d805 + 898b90d commit 799f4c2

File tree

4 files changed

+70
-8
lines changed

4 files changed

+70
-8
lines changed

CHANGELOG.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,18 @@
1+
<a name="10.0.0"></a>
2+
3+
# 10.0.0 (2020-09-25)
4+
5+
* Updated [`README.md`](https://github.com/hardikpthv/vscode-ng-material-snippets/blob/master/README.md) for new snippets
6+
* Added HTML snippets for
7+
* `<<mat-icon>` control
8+
* `<cdk-tree>` control
9+
* `matSort` directive with `matSortChange` event
10+
111
<a name="7.0.1"></a>
212

313
# 7.0.1 (2019-03-09)
414

5-
* Added documentation to [`README.md`](https://github.com/hardikpthv/vscode-ng-material-snippets/blob/master/README.md) for new snippets
15+
* Updated [`README.md`](https://github.com/hardikpthv/vscode-ng-material-snippets/blob/master/README.md) for new snippets
616
* Added HTML snippets for
717
* `<mat-table>` control
818
* `<mat-cell>` control

README.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
# Angular Material v7 Snippets for VS Code
1+
# Angular Material v10 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)
5+
[![Downloads](https://vsmarketplacebadge.apphb.com/downloads-short/hardikpthv.AngularMaterial.svg)](https://marketplace.visualstudio.com/items?itemName=hardikpthv.AngularMaterial)
56
[![Ratings](https://vsmarketplacebadge.apphb.com/rating-short/hardikpthv.AngularMaterial.svg)](https://marketplace.visualstudio.com/items?itemName=hardikpthv.AngularMaterial)
67
[![made-for-VSCode](https://img.shields.io/badge/Made%20for-VSCode-1f425f.svg)](https://code.visualstudio.com/)
78

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

2122
## Usage
@@ -88,15 +89,20 @@ Start typing `a-md-*` and hit `enter`, the snippet spreads out.
8889
| a-md-tree | `<mat-tree>` control |
8990
| a-md-tree-node | `<mat-tree-node>` control |
9091
| a-md-tree-nested-node | `<mat-nested-tree-node>` control |
92+
| a-md-icon | `<mat-icon>` control |
93+
| a-md-sort | `matSort` directive with `matSortChange` event |
94+
| a-md-tree | `<cdk-tree>` control |
9195

9296
### TypeScript Snippets
9397

9498
| Snippet | Purpose |
9599
| ------------- | --------------------------- |
96100
| a-md-snackbar | `MatSnackBar` configuration |
97101

98-
### Using NgRx in Angular Apps
102+
### Using NgRx or WebComponents 🤔
99103

100-
- Check out [NgRx Snippets](https://bit.ly/ngrx-vscode)
104+
- Check out:
105+
- [NgRx Snippets](https://bit.ly/ngrx-vscode)
106+
- [Webcomponents and Lit Snippets](https://bit.ly/lit-vscode)
101107

102108
#### Inspiration from [Angular Typescript Snippets](https://marketplace.visualstudio.com/items?itemName=johnpapa.Angular2) by [John Papa](https://github.com/johnpapa/)

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"name": "AngularMaterial",
3-
"displayName": "Angular Material v7 snippets",
3+
"displayName": "Angular Material v10 snippets",
44
"description": "Angular Material with HTML and TypeScript snippets",
5-
"version": "7.0.0",
5+
"version": "10.0.0",
66
"publisher": "hardikpthv",
77
"license": "MIT",
88
"icon": "images/angular.png",
@@ -20,7 +20,7 @@
2020
},
2121
"keywords": [
2222
"Angular",
23-
"Angular 6",
23+
"Angular 10",
2424
"Material",
2525
"Angular Material",
2626
"HTML"

snippets/html.json

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -543,5 +543,51 @@
543543
"<!-- press ctrl + space to add more column snippet or delete this line -->\n"
544544
],
545545
"description": "<mat-header-cell> column for </mat-table> control "
546+
},
547+
"matIcon": {
548+
"prefix": "a-md-icon",
549+
"body": [
550+
"<mat-icon aria-hidden=\"false\" aria-label=\"{2:label} icon\">${1:icon}</mat-icon>"
551+
],
552+
"description": "mat-icon control"
553+
},
554+
"matSort": {
555+
"prefix": "a-md-sort",
556+
"body": ["matSort (matSortChange)=\"${1:methodName}($event)\""],
557+
"description": "matSort directive with matSortChange event"
558+
},
559+
"cdkTree": {
560+
"prefix": "a-md-tree",
561+
"body": [
562+
"<cdk-tree [dataSource]=\"${1:dataSource}\" [treeControl]=\"${2:treeControl}\">",
563+
"\t<cdk-tree-node",
564+
"\t\t*cdkTreeNodeDef=\"let node;\"",
565+
"\t\tcdkTreeNodePadding",
566+
"\t\t[style.display]=\"${4:logic}\"",
567+
"\t>",
568+
"\t\t<button mat-icon-button disabled></button>",
569+
"\t\t{{node.name}}",
570+
"\t</cdk-tree-node>",
571+
"\t<cdk-tree-node",
572+
"\t\t*cdkTreeNodeDef=\"let node; when: hasChild\"",
573+
"\t\tcdkTreeNodePadding",
574+
"\t\t[style.display]=\"${4:logic}\"",
575+
"\t>",
576+
"\t\t<button",
577+
"\t\t\tmat-icon-button",
578+
"\t\t\tcdkTreeNodeToggle",
579+
"\t\t\t[attr.aria-label]=\"'Toggle ' + node.name\"",
580+
"\t\t\t(click)=\"node.isExpanded = !node.isExpanded\"",
581+
"\t\t\t[style.visibility]=\"node.expandable ? 'visible' : 'hidden'\"",
582+
"\t\t>",
583+
"\t\t\t<mat-icon class=\"mat-icon-rtl-mirror\">",
584+
"\t\t\t\t{{treeControl.isExpanded(node) ? 'expand_more' : 'chevron_right'}}",
585+
"\t\t\t</mat-icon>",
586+
"\t\t</button>",
587+
"\t\t{{node.name}}",
588+
"\t</cdk-tree-node>",
589+
"</cdk-tree>"
590+
],
591+
"description": "<cdk-tree> control"
546592
}
547593
}

0 commit comments

Comments
 (0)