angular-table icon indicating copy to clipboard operation
angular-table copied to clipboard

explanatory comments for home page example

Open msakrejda opened this issue 12 years ago • 1 comments

Hi,

Thanks for the great component. I was somewhat confused by the example, though--my comments on the unclear pieces are inlined below:

    <angular-table model="[
    { id: 1, name: 'Bob', street: '1 street ave' },
    { id: 2, name: 'Kristen', street: '10 road place' },
    { id: 3, name: 'Sarah', street: '30 gravel road' }
    ]" filter-query-model="filterQuery" default-sort-column="id">
<!-- what happens if i leave out default-sort-column? does it just use the first one? does it not sort by default? -->
    <header-row>
    <header-column sortable="true" sort-field-name="id">
<!-- why the div with `display: inlineeblock`? as far as i can tell, the result is identical to the second column, which skips this -->
    <div style="display: inline-block;">Id</div>
<!-- are these needed when setting a column to sortable? what happens without them? -->
    <sort-arrow-ascending></sort-arrow-ascending>
    <sort-arrow-descending></sort-arrow-descending>
    </header-column>
    <header-column sortable="false" sort-field-name="name">
<!-- you explicitly specify both true and false--does that mean we should not rely on the default? this gets verbose -->
    Name
    </header-column>
   <!-- do i need to specify the sort-field-name in addition to the actual value below? can i still sort if i skip this? -->
    <header-column sortable="true" sort-field-name="street">
    <div style="display: inline-block;">Street</div>
    <sort-arrow-ascending></sort-arrow-ascending>
    <sort-arrow-descending></sort-arrow-descending>
    </header-column>
    </header-row>

    <row on-selected="handleRowSelection(row)" selected-color="#87cefa" even-color="#ffffff" odd-color="#eeeeee">
    <column>{{ row.id }}</column>
    <column>{{ row.name }}</column>
    <column>{{ row.street }}</column>
    </row>
    </angular-table>

Obviously, an example can't document the full API, but there are some clearly confusing pieces here--it would be great to make a better first impression.

Thanks again!

msakrejda avatar Oct 13 '13 17:10 msakrejda

Thanks @deafbybeheading . I agree that I need to complete the examples page. You make some excellent points. Thanks!

davidjnelson avatar Oct 13 '13 18:10 davidjnelson