Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Angular question
Message
Information générale
Forum:
Javascript
Catégorie:
Autre
Divers
Thread ID:
01601977
Message ID:
01602061
Vues:
27
>>In the templatesSearchController I made the following change
>>
>>
>>  $scope.table = searchScreenService.getTable('Descrip', [
>>                { name: 'Descrip', displayName: 'Description' }, { name: 'TmplType', displayName: 'Type' }
>>
>>This seems to work OK (e.g. extra property didn't change a thing, didn't cause exception).
>>
>>Now, my task is in the template
>>
>>
>><tr style='-moz-user-select: none; -webkit-user-select: none; -ms-user-select:none; user-select:none;'>
>>    <th ng-repeat="column in table.columns" ng-click="sort(column)">
>>        {{ column.name }}
>>        <span class="pull-right" href="#" ng-show="column.name === table.sort">
>>            <i ng-class="{'icon-chevron-down': table.dir === 'asc', 'icon-chevron-up': table.dir === 'desc'}"></i>
>>        </span>
>>    </th>
>></tr>
>>
>>
>>Change {{column.name}} to something that would first check if displayName property exists, then use it otherwise use column.name.
>>
>>Do you know how to adjust that code here?
>>
>
>You could probably do something like this:
>
>
><span ng-if="column.displayName == ''">{{column.name}}</span>
><span ng-if="column.displayName != ''">{{column.displayName}}</span>
>
Interesting. Does if check for existence of the property, e.g. since I just added that displayName only in one particular file, would it bomb in others?

I am going to try your suggestion and look into ng-if in more details.
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform