0

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');
    });     

}]);
4

1 に答える 1