0
var app = angular.module('app', []);
app.directive('myGridTable', function($http) {
return {
restrict: 'AE',
link: function(scope, element, attrib) {
$http.get(attrib.src).success(function(response) {
scope.rows = response.data;
});
console.log("message from directive");
angular.forEach(scope.rows, function(value, key) {
console.log(key);
});
}
};
});
感謝.....它是我的錯 –
@DebasishDasGupta歡迎您:)不要忘記將其標記爲接受的:) –