i'm using JHispter and i saw that uses these AngularJS rules: <https://github.com/johnpapa/angular-styleguide/blob/master/a1/README.md>

Using IIFE,Getters,Use Strict, Named Functions,ControllerAs,etc i would like to create a simple page that parse a JSON and show a movie list (title, director,duration) and the one that lasts much longer.
I've searched and tried all day but nothing works. The factory can't be used in the controller tough i inject it using $inject.

That's my index.html

```
<html>
    <head>
        <title>Hello Angular</title>
        <link href="stile.css" rel="stylesheet" type="text/css">
        <link rel="shortcut icon" href="">
    </head>
    <body ng-app="myApp">
        <h1>Hello Angular</h1>
        <div ng-controller="myController as sc">
            <h1>angular JSON test</h1>
           <!--  <p>Print movie list</p>
            <ul >
                <li ng-repeat="film in sc.elencoFilm">
                    {{film.title}}, {{film.director}}, {{film.time}}
                </li>
            </ul>

            <p >Trova il film più lungo: {{sc.maxTimeFilm().title}} </p> -->
        </div>
        <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.min.js"></script>
        <script src="JS/app.config.js"></script> 
        <script src="JS/app.state.js"></script> 
        <script src="JS/app.service.js"></script>
        <script src="JS/app.controller.js"></script> 
    </body>
</html>

```

My app.config.js

```
(function() {
    'use strict';

    angular
    .module("myApp", []) ;
})();

```

My app.state.js

```
(function() {
    'use strict';

    angular
        .module('myApp')
        .config(stateConfig);

    stateConfig.$inject = ['$routeProvider'];

    function stateConfig($routeProvider) {
        $routeProvider.when('/', {
      templateUrl:"index.html",
      controller:"serverController"
    });
    }
})();

```

My app.controller.js

```
(function () {
    'use strict';
    angular
            .module("myApp",[])
            .controller("myController", myController);

    //myController.$inject = ['$scope', '$http'];
    myController.$inject = ['$scope', '$http','myFactory']; 

    function myController($scope, $http, myFactory) {
    //function myController($scope, $http){//, myFactory) {
        var vm = this;
        var elencoFilm={};
        myFactory.getMovies().then(function (response) {
            vm.elencoFilm = response;
        });

        vm.maxTimeFilm = getMaxTimeFilm();
        function getMaxTimeFilm() { //return the longest film
        }
    }    
})();

```

My app.service.js

```
(function () {
    'use strict';
    angular.module('myApp',[])
            .factory('myFactory', myFactory);

    myFactory.$inject = ['$scope', '$http','myFactory'];
    function myFactory($scope, $http) {
        console.log("sono nella factory");
        return {
            getMovies: function ($http) {
                return $http.get('https://api.myjson.com/bins/1bgtg3');
                       /* .then(function (response) {
                            return response.data.movies;
                        });*/
            }
        }
    }

})();

```

it always return this error:
<https://docs.angularjs.org/error/>$injector/unpr?p0=myFactoryProvider%20%3C-%20myFactory%20%3C-%20myController

it can't recognize myFactory into myController function!

in app.controller.js this line

function myController($scope, $http, **myFactory**) {
this break out the error!

Thank you for the help!! :)