Hi!
I was surprised myself but actually it is possible, have a look at his
jsFiddle:
http://jsfiddle.net/pkozlowski_opensource/UakS3/2/
It looks like expressions you can use in the ng-options are quite
powerful. Angular is simply amazing!
Hope this helps,
Pawel
On Fri, Jul 6, 2012 at 4:20 PM, Teren Teh <
ter...@gmail.com> wrote:
> Hi there,
>
> Is there anyway to customize the value and display of the options created by
> ng-options other than what's listed here:
>
http://docs.angularjs.org/api/ng.directive:select
>
> For example, if my ng-options are from an array of [{ type:'cat',
> name:'Tabby'}, {type:'cat', name: 'Bobby'}, {type:'dog', name:'Rover'}]
>
> How would I do this?:
>
> <option value="Tabby">Tabby (Cat)</option>
> <option value="Bobby">Bobby (Cat)</option>
> <option value="Rover">Rover (Dog)</option>
>
> From the docs, it looks like you have no control over the values and the
> display name is based on one attribute of the object.
>
> Thanks!
>
> --
> You received this message because you are subscribed to the Google Groups
> "AngularJS" group.
> To view this discussion on the web visit
>
https://groups.google.com/d/msg/angular/-/SnTyjtCqrv8J.
> To post to this group, send email to
ang...@googlegroups.com.
> To unsubscribe from this group, send email to
>
angular+u...@googlegroups.com.
> For more options, visit this group at
>
http://groups.google.com/group/angular?hl=en.