0

I am new to Angular and I am creating my first app right now. I have a factory in place and my controller should be pulling in data from my source, however I keep on getting this error. My factory is called SpreadsheetFactory.

I have the code for my controller below. Any help is appreciated, thanks!

(function () {

     angular
    .module('beerApp')
    .controller('appController', appController, ['$scope', 'SpreadsheetFactory']);

    function appController($scope, SpreadsheetFactory) {

        SpreadsheetFactory.getData().then( function (data) {
            console.log(data)
        });

        // $scope.brews = [];

        return data;
    }

})();
1
  • 2
    Can you share the code for the SpreadsheetFactory factory? :) Commented Aug 19, 2015 at 20:18

1 Answer 1

3

This line is wrong:

.controller('appController', appController, ['$scope', 'SpreadsheetFactory']);

It should be:

.controller('appController', ['$scope', 'SpreadsheetFactory', appController]);
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.