ここで述べたのとまったく同じ問題があります: How to have a default option in Angular.js select box
ただし、以下の私の問題を解決する答えはありません。最初のカテゴリを選択内に表示しようとしています:
<p>Choose a tag category:</p>
<div class="select-style">
<select ng-model="modal.addedTag" ng-init="modal.addedTag = modal.categories[0].name" ng-options="category.name for category in modal.categories">
<!-- <option value="brand" selected>Brand</option>
<option value="client">Client</option>
<option value="company-name">Company Name</option>
<option value="government">Government</option>
<option value="events">Events</option>
<option value="industry">Industry</option>
<option value="products">Products</option>
<option value="news">News</option> -->
</select>
</div>
私のコントローラーのモデル:
var vm = this;
vm.categories = [
{ name: 'brand' },
{ name: 'client' },
{ name: 'competitor-name' },
{ name: 'company-name' },
{ name: 'government' },
{ name: 'events' },
{ name: 'industry' },
{ name: 'people' },
{ name: 'philanthropic' },
{ name: 'products' },
{ name: 'product-category' },
{ name: 'product-feature' },
{ name: 'place' },
{ name: 'problem' },
{ name: 'news' },
{ name: 'related-company-name' },
{ name: 'trend' }
];