Salut a tous !
Je suis débutant sur Angular, et je souhaiterai me former un peu a cette techno.
voici mon code ;
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
| <section>
<page-title-directive title-str="{{ 'SCREEN.EXTRA-CATEGORY-LIST.TITLE' | translate }}"></page-title-directive>
<page-menu-directive can-create="true" create-ui-sref="extracategory({id: 'new'})" can-remove="false" ></page-menu-directive>
</section>
<section>
<page-search-directive search-placeholder="{{ 'SCREEN.EXTRA-CATEGORY-LIST.SEARCH' | translate }}" search-model="query.search" search-query="query" search-fct="getExtraCategories"></page-search-directive>
</section>
<md-table-container>
<table md-table>
<thead md-head>
<tr md-row>
<th md-column>{{ 'DATAS.LABELS.EXTRA-CATEGORY.ID' | translate }}</th>
<th md-column>{{ 'DATAS.LABELS.EXTRA-CATEGORY.NAME' | translate }}</th>
<th md-column>{{ 'DATAS.LABELS.EXTRA-CATEGORY.NAME' | translate }}</th>
<th md-column>{{ 'MENU.ACTIONS' | translate }}</th>
</tr>
</thead>
<tbody md-body>
<tr md-row ng-repeat="extraCategory in extraCategories">
<td md-cell>{{extraCategory.id}}</td>
<td md-cell>{{extraCategory.name}}</td>
<td ng-if="extraCategory.isDefault == true" md-colors="{color:'RED'}" md-cell>{{extraCategory.isDefault}}</td>
<td md-cell>
<md-button class="md-icon-button" ui-sref="extracategory({id: {{extraCategory.id}}})" title="{{ 'ACTION.SHOW.EXTRA-CATEGORY' | translate }}" aria-label="{{ 'ACTION.SHOW.EXTRA-CATEGORY' | translate }}">
<md-icon class="material-icons"> exit_to_app </md-icon>
</md-button>
</td>
</tr>
</tbody>
</table>
</md-table-container>
<md-table-pagination md-limit="query.maxPerPage" md-page="query.page" md-total="{{query.total}}" md-on-paginate="onPaginate" md-page-select></md-table-pagination> |
Voici plus précisément la ligne qui je pense est essentielle :
<td ng-if="extraCategory.isDefault == true" md-colors="{color:'RED'}" md-cell>{{extraCategory.isDefault}}</td>
Ce que je souhaiterai c'est si "extraCategory.isDefault == true" alors mon élément remonte en tete du tableau.
Pourriez vous me donner un coup de main ?
D'avance merci
Partager