Angularjs $http.get().then and binding to a list

前端 未结 4 1677
借酒劲吻你
借酒劲吻你 2020-12-03 00:26

I have a list that looks like this:

  • 4条回答
    •  执笔经年
      2020-12-03 01:23

      Actually you get promise on $http.get.

      Try to use followed flow:

    • {{document.Name}}
    • Where documents is your array.

      $scope.documents = [];
      
      $http.get('/Documents/DocumentsList/' + caseId).then(function(result) {
          result.data.forEach(function(val, i) { 
              $scope.documents.push(/* put data here*/);
          });
      }, function(error) {
          alert(error.message);
      });                       
      

    提交回复
    热议问题