I'm attempting to load a JSON file into my JavaScript file. However, I am at a loss at how to do so.
My app.js file:
var myApp = angular.module('myApp', []);
myApp.controller('MainCtrl', ['$scope', function ($scope) {
console.log("in here");
var jsonData = require('../test_data.json');
console.log(jsonData);
}]);
I have a test_data.json file in my project directory. The error above gives a "require is not defined", so it seems that I must install RequireJS? Is there another way to do so without installing any plugins?