Skip to content

Instantly share code, notes, and snippets.

@byronferguson
Created August 12, 2015 16:41
Show Gist options
  • Save byronferguson/b297d74cdb5830114528 to your computer and use it in GitHub Desktop.
Save byronferguson/b297d74cdb5830114528 to your computer and use it in GitHub Desktop.
AngularJS Factory not found
app.factory('InterviewPageFactory', function($http, URL) {
var getData = function(pageID) {
return $http.get(URL + 'interviews/page/' + pageID);
}
return {
getData: getData
};
});
app.controller('interviewPage', ['$http', '$scope', '$log', function($http, $scope, $log) {
var self = this;
self.questions = [];
self.question = {};
self.fetchQuestions = function() {
InterviewPageFactory.getData(6).then(function(result) {
self.questions = result.questions;
});
};
self.fetchQuestions();
console.log(self.questions);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment