Skip to content

Commit

Permalink
Use class syntax in <dom-repeat> documentation (Polymer#5077)
Browse files Browse the repository at this point in the history
  • Loading branch information
MajorBreakfast committed Feb 1, 2018
1 parent 78558b8 commit 97837c7
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 97837c7

Please sign in to comment.