Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angularjs/25.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html AngularJS:当没有匹配项时,更改Angular所选插件的占位符文本_Html_Angularjs_Angular Chosen - Fatal编程技术网

Html AngularJS:当没有匹配项时,更改Angular所选插件的占位符文本

Html AngularJS:当没有匹配项时,更改Angular所选插件的占位符文本,html,angularjs,angular-chosen,Html,Angularjs,Angular Chosen,正如您从标题中看到的,我试图更改占位符文本,该文本显示“无结果匹配”,并且从所选标记中灰显(禁用) 我试过使用“占位符”,但不起作用 <div> <select chosen disable-search="true" id="newpaymentMethod" placeholder="Placeholder text" class="easytrade-input full-width" name="newpaymen

正如您从标题中看到的,我试图更改占位符文本,该文本显示“无结果匹配”,并且从所选标记中灰显(禁用)

我试过使用“占位符”,但不起作用

<div>
    <select chosen disable-search="true" id="newpaymentMethod"
            placeholder="Placeholder text"
            class="easytrade-input full-width" name="newpaymentMethod"
            ng-model="vm.newRecord.paymentMethod"
            ng-options="paymentMethod.type as paymentMethod.description
                for paymentMethod in vm.paymentMethodOptions"
            required>
    </select>
</div>

然后我尝试了“无结果文本”,仍然不起作用

<div>
    <select chosen disable-search="true" id="newpaymentMethod"
            no_results_text="Placeholder test"
            class="easytrade-input full-width" name="newpaymentMethod"
            ng-model="vm.newRecord.paymentMethod"
            ng-options="paymentMethod.type as paymentMethod.description
                for paymentMethod in vm.paymentMethodOptions"
            required>
    </select>
</div>

你知道吗?
谢谢

在我查看了的GitHub文档之后,我发现了如何使用“no_result_text”

请参阅下面的代码:

<div>
    <select chosen disable-search="true" id="newpaymentMethod"
            no-results-text="'Placeholder test'"
            class="easytrade-input full-width" name="newpaymentMethod"
            ng-model="vm.newRecord.paymentMethod"
            ng-options="paymentMethod.type as paymentMethod.description
                for paymentMethod in vm.paymentMethodOptions"
            required>
    </select>
</div>

因此,您必须使用“无结果文本”而不是“无结果文本”,并且文本应以“”换行,如下面的“'text here'”

希望能帮助别人我的答案:)