0
votes

I'm new at angular. I started a new proyect at cloud9, things work, but i'm getting an error in chrome's console. I started by erasing lots of lines of code and now i have just two lines on js and I still can't detect where is the problem. Im sure it is a stupid mistake, but i'm sutcked.

Can you please tell me where does this error come's from?

TypeError: Cannot read property '$id' of undefined at arguments.(anonymous function) (chrome-extension://ighdmehidhipcmcojjgiloacoafjmpfk/dist/hint.js:2001:19) at m.$digest (https://ajax.googleapis.com/ajax/libs/angularjs/1.5.0/angular.min.js:138:399) at m.scopePrototype.$digest (chrome-extension://ighdmehidhipcmcojjgiloacoafjmpfk/dist/hint.js:2016:23) at m.$apply (https://ajax.googleapis.com/ajax/libs/angularjs/1.5.0/angular.min.js:141:341) at m.scopePrototype.$apply (chrome-extension://ighdmehidhipcmcojjgiloacoafjmpfk/dist/hint.js:2079:22) at https://ajax.googleapis.com/ajax/libs/angularjs/1.5.0/angular.min.js:21:44 at Object.invoke (https://ajax.googleapis.com/ajax/libs/angularjs/1.5.0/angular.min.js:41:295) at Ac.c (https://ajax.googleapis.com/ajax/libs/angularjs/1.5.0/angular.min.js:20:468) at Object.Ac.ia.resumeBootstrap (https://ajax.googleapis.com/ajax/libs/angularjs/1.5.0/angular.min.js:21:357) at maybeBootstrap (chrome-extension://ighdmehidhipcmcojjgiloacoafjmpfk/dist/hint.js:569:11)

angular.module("appAgenda", [])
  .controller("article-categories-list", ["$scope",
    function($scope) {
      $scope.categories = "asd";
    }
  ]);
<!DOCTYPE html>
<html ng-app="appAgenda" lang="es">

<head>
  <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.0/angular.min.js"></script>
</head>

<body>
  <div ng-controller="article-categories-list as ctrl" class="row"><span ng-bind="categories"></span>
  </div>
</body>

</html>

EDIT: While changing the code to isolate the problem with the code snippet i realized that it throws no error. But still getting that error using cloud9. The issue could be there..

2
One thing you have injected the getDBInfo in article-categories-list controller but you haven't include the dbInfo module.Banik
Thanks for pointing that! I've changed the code nowHernan

2 Answers

0
votes

In your controller you forgot to inject $http possibly also getDBInfo

angular.module("appAgenda", [])
  .controller("article-categories-list", ["$scope","$http"
    function($scope, $http) {
      $scope.categories = "asd";
    }
  ]);
0
votes

Solved running the exactly same code in a local server. The problem is at c9...