简体   繁体   中英

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

I am using below snippet, I see just select (dropdown's; array of phones is of size 3, so I am seeing 3 select elements), but I don't see any other element put after it (like phone.name, paragraph tags etc). Could not understand why the elements after select element are not displayed. Can you please help in answering this doubt.

<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>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM