I am trying to create an Angularjs application and am having problems with my controller.
'use strict';
angular.module('myApp.controllers', []).
controller('AppCtrl', function ($scope, $http) {
}).
controller('indexCTRL', function ($scope) {
$http.get('/api/frettir').
success(function(data, status, headers, config) {
$scope.posts = data;
});
});
But when I run it, an error appears indicating that $ http is not defined. What can I improve?
source
share