首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何在angular 2的ng2-tag-input下拉菜单中添加一个按钮?

如何在angular 2的ng2-tag-input下拉菜单中添加一个按钮?
EN

Stack Overflow用户
提问于 2017-06-13 20:43:08
回答 0查看 1K关注 0票数 2

我正在尝试为我的下拉列表使用ng2-tag-input创建自定义模板。我使用这个作为参考:this link。我已经使用observable检索了一个对象数组,并填充了下拉列表。

下面是我的html代码(还没有按钮):

代码语言:javascript
复制
<div class="users-container">
<tag-input [ngModel]="[]" [style.width]="100" theme="bootstrap" [onlyFromAutocomplete]="false" addOnBlur="true" addOnEnter="true" addOnSpace="true">
    <tag-input-dropdown [showDropdownIfEmpty]="true" [autocompleteObservable]='autocompleteItems$' [identifyBy]="'id'" [displayBy]="'name'">
        <!--custom template-->
        <ng-template let-item="item" let-index="index">
            <div class="float-left">
                <img class="user-image" src="{{item.photo}}" alt="user-image">
            </div>
            <div class="float-right">
                <span class="name">{{item.name}}</span>
                <span class="name">{{item.lname}}</span>
                <p>( {{item.dept}} )</p>
            </div>
            <div class="clear"></div>
        </ng-template>
    </tag-input-dropdown>
</tag-input> 

我能够成功地获得我的自定义模板,但我还需要显示两个按钮以及下拉值,例如:the custom template repeats and at the end, there are these 2 buttons I need。我不知道如何添加它们,因为我是Angular2的新手。任何帮助都将不胜感激。

EN

回答

页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/44521892

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档