Skip to content

Commit

Permalink
Merge pull request #5083 from MajorBreakfast/patch-2
Browse files Browse the repository at this point in the history
Use class syntax in <dom-repeat> documentation (#5077)
  • Loading branch information
TimvdLippe authored Feb 1, 2018
2 parents 78558b8 + 97837c7 commit 86399df
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 22 deletions.
28 changes: 17 additions & 11 deletions lib/elements/dom-repeat.html
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,22 @@
* </template>
*
* <script>
* Polymer({
* is: 'employee-list',
* ready: function() {
* this.employees = [
* {first: 'Bob', last: 'Smith'},
* {first: 'Sally', last: 'Johnson'},
* ...
* ];
* class EmployeeList extends Polymer.Element {
* static get is() { return 'employee-list'; }
* static get properties() {
* return {
* employees: {
* value() {
* return [
* {first: 'Bob', last: 'Smith'},
* {first: 'Sally', last: 'Johnson'},
* ...
* ];
* }
* }
* };
* }
* });
* }
* < /script>
*
* </dom-module>
Expand Down Expand Up @@ -102,8 +108,8 @@
* For example, for an `dom-repeat` with a filter of the following:
*
* ```js
* isEngineer: function(item) {
* return item.type == 'engineer' || item.manager.type == 'engineer';
* isEngineer(item) {
* return item.type == 'engineer' || item.manager.type == 'engineer';
* }
* ```
*
Expand Down
28 changes: 17 additions & 11 deletions types/lib/elements/dom-repeat.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,22 @@ declare namespace Polymer {
* </template>
*
* <script>
* Polymer({
* is: 'employee-list',
* ready: function() {
* this.employees = [
* {first: 'Bob', last: 'Smith'},
* {first: 'Sally', last: 'Johnson'},
* ...
* ];
* class EmployeeList extends Polymer.Element {
* static get is() { return 'employee-list'; }
* static get properties() {
* return {
* employees: {
* value() {
* return [
* {first: 'Bob', last: 'Smith'},
* {first: 'Sally', last: 'Johnson'},
* ...
* ];
* }
* }
* };
* }
* });
* }
* < /script>
*
* </dom-module>
Expand Down Expand Up @@ -91,8 +97,8 @@ declare namespace Polymer {
* For example, for an `dom-repeat` with a filter of the following:
*
* ```js
* isEngineer: function(item) {
* return item.type == 'engineer' || item.manager.type == 'engineer';
* isEngineer(item) {
* return item.type == 'engineer' || item.manager.type == 'engineer';
* }
* ```
*
Expand Down

0 comments on commit 86399df

Please sign in to comment.