簡體   English   中英

加載頁面時,在select / ng-options之后的HTML元素不可見

[英]Html elements which are after select/ng-options are not visible when page is loaded

我在下面的代碼段中使用,我看到的只是select(下拉列表;電話數組的大小為3,所以我看到了3個select元素),但是之后沒有看到其他任何元素(例如phone.name,段落標簽)等等)。 無法理解為什么未顯示選擇元素之后的元素。 您能幫助回答這個疑問嗎?

<div>
    <ul>
        <li ng-repeat="phone in phones track by phone.id">
            <select ng-model="selectedName" ng-options="x for x in names" />
            <span>{{phone.name}}</span>
            <p>{{phone.snippet}}</p>
            <p> {{phone.id}}</p>
            [ <a href="" ng-click="RemoveFromPhonesArray(phone.id)">X</a> ]
            <p> index is {{$index}}</p>
        </li>
    </ul>
</div>

這是因為select是一個配對標簽,所以您需要使用結束標簽<select ng-options=...></select>

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM