i am trying to get a simple angular.js script working, just getting information from a mysql db and show them via ng-repeat. The site is just blank, no error or something like that ... so i suggest i got a logical problem here.
controller:
var app = angular.module('ISPapp', []);
app.controller('artikelController', function($scope, $http) {
getArtikel();
function getArtikel(){
$http.post("ajax/get_artikel.php").success(function(data){
$scope.artikel_entrys = data;
});
};
});
Output:
<table ng-controller="artikelController">
<thead><tr><th>ID</th><th>Artikelnr</th><th>Kit</th><th>Min Bestand</th><th>Beschreibung</th>< tr></thead>
<tbody>
<tr ng-repeat="row in artikel_entrys">
<td>{{row.id}}</td>
<td>{{row.artikelnr}}</td>
<td> Test </td>
<td>{{row.min_bestand}}</td>
<td>{{row.beschreibung}}</td>
</tr>
</tbody> </table>
Index:
<!DOCTYPE html>
<html ng-app="ISPapp">
<head>
<script type="text/javascript" src="js/angular.min.js"></script>
<script type="text/javascript" src="js/app.js"></script>
</head>
<body ng-controller="artikelController">
<div ng-include src="app/artikel.html"></div>
</body>
</html>
The json object from PHP is fine.
Thanks for your help in advance!
gz Pad
ng-controller="artikelController"from thetabletag, two stop controller initialization twice