1

это странная вещь:просто выберите вход не работает должным образом с угловым-метеором

с использованием библиотеки угловых метеоритного

поставить простой выберите вход на странице:

<div id="category"> 
<select ng-model="selectedItem"> 
<option ng-repeat="p in inputCategories" value="{{p.name}}"></option> 
</select> 
</div> 

выбирает сам себя, он имеет правильное количество опций, но фактический текст опции невидим!

Когда осмотр, он показывает следующее:

<select class="ng-pristine ng-valid ng-touched" ng-model="selectedItem"> 

    <option value="? undefined:undefined ?"></option> 
    <!-- 

    ngRepeat: p in inputCategories 

    --> 
    <option class="ng-scope" value="Cost Source Actuals" ng-repeat="p in inputCategories"></option> 
    <!-- 

    end ngRepeat: p in inputCategories 

    --> 
    <option class="ng-scope" value="Cost Source Budget" ng-repeat="p in inputCategories"></option> 
    <!-- 

    end ngRepeat: p in inputCategories 

    --> 
    <option class="ng-scope" value="Chart of Accounts" ng-repeat="p in inputCategories"></option> 
    <!-- 

    end ngRepeat: p in inputCategories 

    --> 
    <option class="ng-scope" value="Cost Center Master" ng-repeat="p in inputCategories"></option> 
    <!-- 

    end ngRepeat: p in inputCategories 

    --> 
    <option class="ng-scope" value="Headcount by Department Cost Center Labor" ng-repeat="p in inputCategories"></option> 
    <!-- 

    end ngRepeat: p in inputCategories 

    --> 
    <option class="ng-scope" value="Fixed Asset Register" ng-repeat="p in inputCategories"></option> 
    <!-- 

    end ngRepeat: p in inputCategories 

    --> 
    <option class="ng-scope" value="AccountView Inventory" ng-repeat="p in inputCategories"></option> 
    <!-- 

    end ngRepeat: p in inputCategories 

    --> 
    <option class="ng-scope" value="DC Facilities" ng-repeat="p in inputCategories"></option> 
    <!-- 

    end ngRepeat: p in inputCategories 

    --> 
    <option class="ng-scope" value="GL accounts" ng-repeat="p in inputCategories"></option> 
    <!-- 

    end ngRepeat: p in inputCategories 

    --> 
    <option class="ng-scope" value="NextGen data" ng-repeat="p in inputCategories"></option> 
    <!-- 

    end ngRepeat: p in inputCategories 

    --> 
    <option class="ng-scope" value="Profit and Loss data" ng-repeat="p in inputCategories"></option> 
    <!-- 

    end ngRepeat: p in inputCategories 

    --> 
    <option class="ng-scope" value="Vendors" ng-repeat="p in inputCategories"></option> 
    <!-- 

    end ngRepeat: p in inputCategories 

    --> 

</select> 

и вот контроллер:

angular.module("collector").controller("CollectorCtrl", ['$scope', '$stateParams', '$meteor', 
    function($scope, $stateParams, $meteor, $location){ 

     $scope.inputCategories = [ 
      { 
       name: 'Cost Source Actuals' 
      }, 
      { 
       name: 'Cost Source Budget' 
      }, 
      { 
       name: 'Chart of Accounts' 
      }, 
      { 
       name: 'Cost Center Master' 
      }, 
      { 
       name: 'Headcount by Department Cost Center Labor' 
      }, 
      { 
       name: 'Fixed Asset Register' 
      }, 
      { 
       name: 'AccountView Inventory', 
       collectionName: 'AccountView_Inventory' 

      }, 
      { 
       name: 'DC Facilities', 
       collectionName: 'DC_Facilities' 

      }, 
      { 
       name: 'GL accounts', 
       collectionName: 'GL_accounts' 

      }, 
      { 
       name: 'NextGen data', 
       collectionName: 'NextGen_data' 

      }, 
      { 
       name: 'Profit and Loss data', 
       collectionName: 'Profit_and_Loss_data' 

      }, 
      { 
       name: 'Vendors' 
      } 
     ]; 


    }]); 

Кто-нибудь есть какие-либо идеи о том, что это может быть?

ответ

3

Текст, указанный внутри option, будет отображаться в вашем варианте. Вы пропустили добавить текст внутри тега option.

Markup

<select ng-model="selectedItem"> 
    <option ng-repeat="p in inputCategories" value="{{p.name}}">{{p.name}}</option> 
</select> 
Смежные вопросы