0
這裏我的代碼指令從服務傳遞數據的指令在AngularJs
app.directive('studentlist',function(){
return{
restrict:'E',
scope: {},
templateUrl:'js/directives/studentList.html'
};
});
,這裏是爲我服務的代碼
app.factory('students',['$http',function($http){
return $http.get('http://localhost/database2/php/students.php')
.success(function(data){
return data;
})
.error(function(err){
return err;
});
}]);
我的繼承人HTML片段
<div ng-repeat="student in studentList" class="row border">
<studentList info="{{ students.info }}"></studentlist>
</div>
我需要知道如何從服務到指令傳遞數據。所以它顯示在標籤
感謝您的反饋,我的JSON看起來是這樣的標識: 「2015552117」 姓: 「失讀症」 中間名: 「吉諾」 名字: 「貝拉」 性別: 「男」 出生日期:「 2015年4月30" 日 狀態: 「阿布賈」 YearEnrolled: 「0000」 EducationalLevel: 「JS 2」 LGA: 「特馬」 狀態: 「」 –