angular.module("noteWrangler") .controller("NotesIndexController", function ($http, $scope) { const errorHandler = function (err) { console.log("Error getting /notes", err); }; const responseHandler = function (data) { $scope.notes = data.data; }; $http({ method: "GET", url: "/notes.json" }).then(responseHandler, errorHandler); });