Skip to content

Commit

Permalink
Update types
Browse files Browse the repository at this point in the history
  • Loading branch information
TimvdLippe committed Feb 2, 2018
1 parent 636abae commit 5fa059f
Showing 1 changed file with 30 additions and 20 deletions.
50 changes: 30 additions & 20 deletions types/lib/elements/array-selector.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,40 +143,50 @@ declare namespace Polymer {
* <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);
* }
* }
* ```
*/
class ArraySelector extends
Expand Down

0 comments on commit 5fa059f

Please sign in to comment.