Answer the question
In order to leave comments, you need to log in
How to process a template in angular at the time of receiving ajax response?
The html file has labels for displaying information:
<div class="container" ng-controller="MainController">
<span class="blc" ng-repeat="process in processess">
<i class="fa fa-space-shuttle"></i>
<span class="p-left ">{{ process.caption }}</span>
</span>
</div>
app.controller('MainController', ['$scope', function($scope) {
/*
если оставить так, то данные выведутся, ибо они уже присутствуют при загрузке страницы
$scope.processess = [
{caption: "ОПИСАНИЕ_1"},
{caption: "ОПИСАНИЕ_2"}
];
*/
// однако, данные лежат в базе, и я их вытаскиваю через jquery.ajax + custom
service.processtypes().then(function(data){
// $scope.processess не отрабатывает и не отображается на странице
$scope.processess = [
{caption: data[0]},
{caption: data[1]}
];
});
}]);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question