Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bindLabel subobject #159

Closed
koss89 opened this issue Dec 8, 2017 · 4 comments
Closed

bindLabel subobject #159

koss89 opened this issue Dec 8, 2017 · 4 comments
Assignees
Labels

Comments

@koss89
Copy link

koss89 commented Dec 8, 2017

Good afternoon.
faced such a problem:
I need in bindLabel to withdraw from the object inside the object for example I have an object:
{
id: "2334",
tags: {
name: "test"
}
}

Accordingly I do bindLabel = "tags.name" but I get empty lines

@koss89
Copy link
Author

koss89 commented Dec 8, 2017

I'm sorry solved using templates:

<ng-select [items]="_lines"
        [(ngModel)]="_selectedline"
        bindLabel="tags.name">
        <ng-template ng-label-tmp let-item="item">
            {{item.tags.name}}
        </ng-template>
        <ng-template ng-option-tmp let-item="item">
            {{item.tags.name}}
        </ng-template>
</ng-select>

@koss89 koss89 closed this as completed Dec 8, 2017
@varnastadeus varnastadeus reopened this Dec 8, 2017
@varnastadeus
Copy link
Member

@koss89 good catch, I think it should be supported with tags.name expression so I am reopening this.

@koss89
Copy link
Author

koss89 commented Dec 11, 2017

in the process revealed another feature in the version that I described above, the filter (Autocomplete) is not working, so this is another plus to re-opening

@varnastadeus varnastadeus self-assigned this Dec 12, 2017
@varnastadeus varnastadeus added this to the Version 1.0.0 milestone Dec 15, 2017
jakemdunn pushed a commit to jakemdunn/ng-select that referenced this issue Oct 16, 2018
@elVengador
Copy link

tu can use this:

<ng-select [(ngModel)]="_selectedline">
   <ng-option *ngFor="let item of items" [value]="item.id">{{item.tags.name}}</ng-option>
</ng-select>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants