Chapter 1:
angular.module('chapter1', [])
.factory('chapter1Fac', function(){
return {
display: function (){
return('This message is from chapter 1');
}
};
};
Chapter 2:
angular.module('chapter2', ['chapter1'])
.controller('chapter2Ctrl', function (chapter1Fac, $scope){
$scope.output = chapter1Fac.display();
}
What modifications do I need to make in this code to access the information from chapter 1's factory in chapter 2's controller?