Angularjs ui-select重复内部的动态对象映射

问题描述 投票:0回答:1

我的ui-select指令代码在下面工作正常。在重复内部,我需要将CODE对象(即ID)的属性设置为动态代码[fwValueProperty]。据我所知,它不是ng-repeat所以我不能将它用作代码[fwValueProperty]。我怎样才能实现这一目标?

<div>
    <ui-select name="{{fwName}}"
               id="{{fwId}}"
               theme="bootstrap"
               ng-model="fwValue"
               reset-search-input="false"
               append-to-body="true"
               search-enabled="true"
               on-select="onSelected(fwValue)">
        <ui-select-match placeholder="Seçiniz..."><span ng-bind="$select.selected[fwDescriptionProperty]"></span> </ui-select-match>
        <ui-select-choices repeat="code.ID as code in fwCodes  | propsFilter: { '{{fwDescriptionProperty}}': $select.search} track by $index"
                           refresh-delay="0">
            <div ng-bind-html="code[fwDescriptionProperty] | highlight: $select.search"></div> <!--fwDescriptionProperty , descriptionProp(item)-->
        </ui-select-choices>
    </ui-select>
</div>
angularjs angularjs-directive angularjs-ng-repeat ui-select
1个回答
0
投票

我想我在某个地方做错了。现在它的工作原理应该是:

 <ui-select-choices repeat="code[fwValueProperty] as code in fwCodes  | propsFilter: { '{{fwDescriptionProperty}}': $select.search} track by $index"
                           refresh-delay="0">
© www.soinside.com 2019 - 2024. All rights reserved.