I receive an error while I'm saving my promise in my angular controller:
The controller is:
angular.module('app.controllers')
.controller('questionController', function($log,QuizCreate,QuestionBank){
QuestionBank.get().then(function(response){
this.questions = response.data;
$log.info(response.data);
});
// this.quiz = QuizCreate.generateQuiz();
$log.info(this.questions);
});
And the error I receive is:
TypeError: Cannot set property 'questions' of undefined
Why???