Click here to Skip to main content
15,940,430 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
HI All,

In my Angular project, I am trying to fill in a grid with data from database. For some reason the grid comes back empty and without any data. I don't know what I am doing wrong. I would highly appreciate if anyone would help.

PS: I was following this tutorial and after days and days of it not working , I decided to tweak the code a little bit.[^]

Back to my code:
In my Js file I have got this:

var MyApp = angular.module("MyApp", ["ngResource", "ngRoute"]).
    config(['$routeProvider', function ($routeProvider) {
        $routeProvider.when('/', {templateUrl: 'list.html', controller: 'ListCtrl' }).
            otherwise({ redirectTo: '/' });

MyApp.factory('MyApp',['$resource',  function ($resource) {
    return $resource('/MyApp/:id', { id: '@id' }, { update: {
        method: 'PUT' } });

MyApp.controller('ListCtrl', ['$scope', '$routeParams', 'myapp', function ($scope, $routeParams, myapp) {
    var app = ds72.get({ id:$ });
    $id =;
    $scope.item = MyApp.update({id:$id}, app);

and this is how I am trying to display the info in my HTML file
<tr ng-repeat="item in items">
Is there anything I am missing?
[no name] 8-Oct-14 7:58am    
where is items in your controller code?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900