Я пытаюсь использовать smart Tabl e на удаленных данных, но я не получаю никакого вывода. Я читал в документации, что в данных ajax должен использоваться атрибут stSafeSrc, но, очевидно, я делаю что-то неправильно.Угловая интеллектуальная таблица с данными Ajax не выводится
My Markup выглядит, как это следует
<div class="content">
<div class="container">
{% verbatim %}
{{ rowCollection }}
<button type="button" ng-click="addRandomItem(row)" class="btn btn-sm btn-success">
<i class="glyphicon glyphicon-plus"></i> Add Feed
</button>
<table st-table="displayedCollection" st-safe-src="rowCollection" class="table table-striped">
<thead>
<tr>
<th>Feed Name</th>
<th>parsed Items</th>
<th>Feed Link</th>
<th>Feed Type</th>
<th>Import</th>
<th>Categorize</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="row in displayedCollection">
<td>{{row.feed_type}}</td>
<td>{{ row.id }}</td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</tbody>
</table>
{% endverbatim %}
</div>
</div>
контроллер
october.controllers['dashboard/feeds'] = function ($scope, $filter , $request) {
$.request('onFeeds', {success: function(data, scope){
this.success(data).done(function() {
$scope.rowCollection = [];
$scope.rowCollection = angular.fromJson(data.result);
$scope.displayedCollection = [].concat($scope.rowCollection);
console.log($scope.rowCollection); // Array of Objects is present
});
}
});
}
Что '$ request'? Я спрашиваю, как я заметил, что вы его не используете, но вместо этого вместо '$ .request'. – james
$ request является частью фреймворка (october cms), с которого вы можете совершать вызовы ajax. – fefe
Итак, код для вашего контроллера должен быть '$ request ('onFeeds',' not '$ .request ('onFeeds',' then? – james