-1

在下面的视图中,我正在从 $scope.saveSearchList 重新生成一个下拉列表:

<div class="form-group" ng-controller="TalentPoolController">
  <md-input-container ng-init="SchoolSavedSearches(39424,2,true)"
    class="md-block" style="margin:0 !important;">
    <md-select ng-model="selectedSavedsearch"
      placeholder="Select a Saved Search" id="Md-select2">
      <md-option ng-value="s" ng-repeat="s in savedSearchList">{{s.title}}</md-option>
    </md-select>                                          
  </md-input-container>
</div>

在我的控制器中,我正在更新 $scope.saveSearchList 但它似乎没有反映我的观点。请问我该如何解决?

TalentPoolService.insertSaveSearch(pvarrData)
  .then(function successCallback(response) {

  if (response.data.status == true) {
    TalentPoolService.sucessNotify("Saved Search have been created successfully.", 5000, 640);

            TalentPoolService.GetSchoolSavedSearches(39424, 2, true)
                .then(function successCallback(schoolResponse) {
                    $scope.savedSearchList = schoolResponse.data;
                    $scope.$apply();
                }, function errorCallback(schoolResponse) {

                });
    }
4

1 回答 1

0

我建议将您的第二个回调的“响应”重命名为其他内容。

TalentPoolService.insertSaveSearch(pvarrData)
  .then(function successCallback(response) {

  if (response.data.status == true) {
    TalentPoolService.sucessNotify("Saved Search have been created successfully.", 5000, 640);

    TalentPoolService.GetSchoolSavedSearches(39424, 2, true)
      .then(function successCallback(schoolResponse) {
        $scope.savedSearchList = schoolResponse.data;
        $scope.$apply();
      }, function errorCallback(response) {

      });
    }

此外,您有 TalenPoolService.sucessNotify <- 拼写错误,除非您有一个名为“sucessNotify”的方法。

于 2017-08-24T11:55:17.303 回答