Attempting to work with Angular for the first time and struggling to load a component using data from an http request. Currently encountering a warning when attempting to execute the code with the HTTP request.
Receiving a "Could not instantiate controller HeadlinesController" error message
Sharing my headlines.js file below:
angular.module("RebelsApp.headlines", []).controller("HeadlinesController", HeadlinesController);
function HeadlinesController() {
$http.get('/dl/headlines')
.success(function(dsp) {
var title = "success";
console.log(dsp);
})
.error(function (data, status) {
var title = "fail";
console.log(data);
});
}
Struggling to find examples related to using http requests with the new router in Angular. Any guidance or assistance would be greatly appreciated. Thank you