без псевдонима ngcontroller, я могу получить данные. Однако, когда с псевдонимом, я наклоняю. Может ли кто-нибудь указать мою ошибку здесь?Атрибут отображения ngrepeat из псевдонима ngcontroller
HTML-теги:
<div style="padding: 10px" id="content_dv" ng-controller="displaytopic_ctrl as f">
<div class="topic_dv" ng-repeat="t in f.topic">
<p>{{ t.MEMBER_NAME }}</p>
</div>
</div>
в app.js:
.controller('displaytopic_ctrl', ['$http', function($http) {
$http({
method: 'get',
url: api_url + 'get_topic_list.php',
data: {
type: 'all'
}
}).success(function(d){
if(d.t=='p'){
this.topic = d.topic;
}
}).error(
function(){
console.log('Query error');
});
}]);
'this.topic' не то, что вы думаете, что здесь. – Claies