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

Change in Single Item Template? #52

Closed
carlhussey opened this issue Sep 30, 2017 · 2 comments
Closed

Change in Single Item Template? #52

carlhussey opened this issue Sep 30, 2017 · 2 comments

Comments

@carlhussey
Copy link

carlhussey commented Sep 30, 2017

Was there a recent change in the custom template for a single item?

Here was my setup in 0.1.2:

<ng-select [items]="employees" bindLabel="NTID" placeholder="Search Employees" [typeahead]="typeahead" [(ngModel)]="employeeModel"
    [clearable]="false" type="text" formControlName="exceptionUser">
    <ng-template ng-display-tmp let-item="item">
        {{ item.FirstName + ' ' + item.LastName + ' ('+item.NTID+')'}}
    </ng-template>
    <ng-template ng-option-tmp let-item="item">
        <div class="row">
            <div class="col-md-1"><img src="https://mysite.com/images/{{item.QID}}.jpg" width="35px" height="45px"></div>
            <div class="col-md-11">
                {{ item.FirstName + ' ' + item.LastName }}
                <div class="row">
                    <div class="col-md-12">
                        <small>NTID: {{ item.NTID }} | Location: {{ item.CenterName }}</small>
                    </div>
                </div>
            </div>
        </div>
    </ng-template>

After upgrading to 0.1.3, when I select an Item, the input is only using the bindingLabel value as the information that it shows in the dropdown instead of the custom template.

If this did change, how can I continue to use the template?

@anjmao
Copy link
Member

anjmao commented Sep 30, 2017

@carlhussey Sorry for this, we changed ng-display-tmp to ng-label-tmp, you just need to update this name. As noticed in Readme until 1.0 version there would be some breaking changes at some points.

@anjmao anjmao closed this as completed Sep 30, 2017
@carlhussey
Copy link
Author

No problem on the breaking changes, just wanted to make sure it wasn’t something I broke :). Thanks for the update!

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

No branches or pull requests

2 participants