Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update JSDocs to use <dom-repeat> tags #5085

Merged
merged 1 commit into from
Feb 2, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 30 additions & 20 deletions lib/elements/array-selector.html
Original file line number Diff line number Diff line change
Expand Up @@ -373,40 +373,50 @@
* <template>
*
* <div> Employee list: </div>
* <template is="dom-repeat" id="employeeList" items="{{employees}}">
* <dom-repeat id="employeeList" items="{{employees}}">
* <template>
* <div>First name: <span>{{item.first}}</span></div>
* <div>Last name: <span>{{item.last}}</span></div>
* <button on-click="toggleSelection">Select</button>
* </template>
* <div>Last name: <span>{{item.last}}</span></div>
* <button on-click="toggleSelection">Select</button>
* </template>
* </dom-repeat>
*
* <array-selector id="selector" items="{{employees}}" selected="{{selected}}" multi toggle></array-selector>
*
* <div> Selected employees: </div>
* <template is="dom-repeat" items="{{selected}}">
* <dom-repeat items="{{selected}}">
* <template>
* <div>First name: <span>{{item.first}}</span></div>
* <div>Last name: <span>{{item.last}}</span></div>
* </template>
* </template>
* </dom-repeat>
*
* </template>
*
* </dom-module>
* ```
*
* ```js
* Polymer({
* is: 'employee-list',
* ready() {
* this.employees = [
* {first: 'Bob', last: 'Smith'},
* {first: 'Sally', last: 'Johnson'},
* ...
* ];
* },
* toggleSelection(e) {
* let item = this.$.employeeList.itemForElement(e.target);
* this.$.selector.select(item);
* }
* });
*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'},
* ...
* ];
* }
* }
* };
* }
* toggleSelection(e) {
* let item = this.$.employeeList.itemForElement(e.target);
* this.$.selector.select(item);
* }
*}
* ```
*
* @polymer
Expand Down
9 changes: 5 additions & 4 deletions lib/elements/dom-repeat.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,12 @@
* <template>
*
* <div> Employee list: </div>
* <template is="dom-repeat" items="{{employees}}">
* <dom-repeat items="{{employees}}">
* <template>
* <div>First name: <span>{{item.first}}</span></div>
* <div>Last name: <span>{{item.last}}</span></div>
* </template>
* </template>
* </dom-repeat>
*
* </template>
*
Expand Down Expand Up @@ -116,8 +118,7 @@
* Then the `observe` property should be configured as follows:
*
* ```html
* <template is="dom-repeat" items="{{employees}}"
* filter="isEngineer" observe="type manager.type">
* <dom-repeat items="{{employees}}" filter="isEngineer" observe="type manager.type">
* ```
*
* @customElement
Expand Down
9 changes: 5 additions & 4 deletions types/lib/elements/dom-repeat.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,12 @@ declare namespace Polymer {
* <template>
*
* <div> Employee list: </div>
* <template is="dom-repeat" items="{{employees}}">
* <dom-repeat items="{{employees}}">
* <template>
* <div>First name: <span>{{item.first}}</span></div>
* <div>Last name: <span>{{item.last}}</span></div>
* </template>
* </template>
* </dom-repeat>
*
* </template>
*
Expand Down Expand Up @@ -105,8 +107,7 @@ declare namespace Polymer {
* Then the `observe` property should be configured as follows:
*
* ```html
* <template is="dom-repeat" items="{{employees}}"
* filter="isEngineer" observe="type manager.type">
* <dom-repeat items="{{employees}}" filter="isEngineer" observe="type manager.type">
* ```
*/
class DomRepeat extends
Expand Down