Hi everyone, I would like some help ..
Here is a portion of my view and of my AngularJS controler :

<div class="panel-body">
    <div class="form-group col-xs-2">
        <label for='ratesVectorSelect' class='control-label'> Select Rates 
Vector </label>
        <select id='ratesVectorSelect' class='select form-control'
                ng-init='selectedRatesVector=0'
                ng-change='updateCurrentAssembly()'
                ng-model='selectedRatesVector'
                ng-options='o.id as o.name for o in ratesVectors'>
        </select>
    </div>
    <br/>

    <table class="table" ng-model="currentAssembly">
        <tbody aria-hidden="false">
        <tr>
            <td>Matrices</td>
            <td class="ng-scope" ng-repeat="m in currentAssembly.matrices track 
by $index">
                <select id='matricesSelect-~{$index}~' class='select 
form-control'
                        ng-model='currentAssembly.matrices[$index]'
                        ng-options="o as (o.name + ' (' + o.model + ')') for o 
in rateMatrices track by o.name">
                </select>
                <pre> ~{currentAssembly.matrices[$index]}~ </pre>
            </td>
        </tr>

   </tr>
    <tr>

/** init assembly matrices **/
$scope.initStep3 = function() {

  console.log("init step 3");
  $scope.assemblies = [];
  for (i = 0; i < $scope.ratesVectors.length; i++) {
      var nameVector = $scope.ratesVectors[i].name;
      var numRatesVector = $scope.ratesVectors[i].numRates;
      $scope.assemblies.push({
              rateVector: nameVector,
              matrices: new Array(numRatesVector).fill($scope.rateMatrices[0]),
              lenghts: new Array(numRatesVector).fill($scope.edgeLengths[0]),
              frequencies: new Array(numRatesVector).fill($scope.equFreqs[0])
         });
  }
  $scope.selectedRatesVector = $scope.ratesVectors[0].id;
  $scope.currentAssembly = $scope.assemblies[$scope.selectedRatesVector];
};



Here is the code triggered when I select a new Rates vector : As  my table 
is based on $scope.currentAssembly, it updates correctly, However, the 
values displayed on my select boxes are not correct (they do not change)

$scope.updateCurrentAssembly = function() {
  $scope.currentAssembly = $scope.assemblies[$scope.selectedRatesVector];
};



Thanks..

-- 
You received this message because you are subscribed to the Google Groups 
"Angular and AngularJS discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to