Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Defining new array
Message
De
17/09/2014 03:39:37
 
 
Information générale
Forum:
Javascript
Catégorie:
Autre
Divers
Thread ID:
01607662
Message ID:
01607673
Vues:
44
This message has been marked as the solution to the initial question of the thread.
>Hi everybody,
>
>I can define a new array this way:
>
> var itemTreeHeight = [20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70, 75, 80];
>
>However, how can I reference this array in my code? E.g. I try to use
>
>
> <select class="form-control" ng-model="currentSalespoint.dciHeight"
>                        ng-options="s.value as s.value for s in metaData.itemTreeHeight"></select>
>
>and it doesn't work (e.g. I don't see values).
>
>So, I either need to somehow create an array with named items (how) or find a way to reference it.
>
>Thanks a lot in advance.
>
>UPDATE. Never mind, figured this out. I just needed to use {value:20} to define names for the items.

You don't need to do that. Just use :
<select  data-ng-model="currentSalespoint.dciHeight"
                       data-ng-options="s for s in metaData.itemTreeHeight"></select>
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform