Help with AngularJS - reading JSON file

Posted on 2015-01-12
Last Modified: 2015-01-14
Can you please tell me why this simple sample does not run.
Uncaught Error: [$injector:modulerr] Failed to instantiate

<div ng-app="app" ng-controller="ctrl">

<script src=""></script>

var app = angular.module('app', ['jsonService']);

angular.module('jsonService', ['ngResource'])
.factory('JsonService', function($resource) {
  return $resource('');

app.controller('ctrl', function($scope, JsonService){
    $scope.catalog = data;
Question by:JElster
LVL 42

Accepted Solution

Rob Jurd, EE MVE earned 500 total points
ID: 40545824
Please check the console in your developer tools as it could be a cross origin issue

open your developer tools and see the error that appears in the console.,console

Author Comment

ID: 40545834
Don't see anything in the console.. I see this.. I need it in Angular.

(function() {
  var uri = "";
    url: uri,
    dataType: 'json',
    success: function(data) {
  }).done(function() {

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Auto Submit on dropdown box 3 37
Remove 'disabled' attribute 6 28
getting id from database 5 24
Need a good Angular tutorial 5 35
Avoid defining the variables in the global scope; trying to define them in a local function scope. Because:   • Look-up is performed every time a variable is accessed.   • Variables are resolved backwards from most specific to least specific scope…
In my daily work (mainly using, I need to write a lot of JavaScript code. One of the most repetitive tasks I do are the jQuery Ajax calls. You know: (CODE) I don't know if for you it's the same, but for me is soooo tedious to write the …
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now