1234567891011121314151617 |
- angular.module("noteWrangler")
- .controller("NotesShowController", function ($http, $routeParams, $scope) {
- const errorHandler = function (err) {
- console.log("Error getting /notes", err);
- };
- const responseHandler = function (data) {
- const id = parseInt($routeParams.id, 10);
- $scope.note = data.data[id];
- };
- $http({
- method: "GET",
- url: "/notes.json"
- }).then(responseHandler, errorHandler);
- });
|