I am getting javascript run time error 

> 
> myApp is undefined
> 
> 
> 

for my angular service. Don't know what wrong im doing here..

This is how i defined my app.js

**app.js**

```
var myApp = angular.module('myApp', [
    'ngRoute', 'motorControllers', 'motorDetailsController', 'motorServices', 'ngSanitize', 'ui.select', 'ngResource',]);

myApp.config(['$routeProvider',
  function ($routeProvider) {
      $routeProvider.
        when('/motors', {
            templateUrl: 'View/motorList.html',
            controller: 'motorController'
        }).
        when('/motors/:Id', {
            templateUrl: 'View/motorDetails.html',
            controller: 'motorDetailsController'
        }).
        otherwise({
            redirectTo: '/motors'
        });
  }]);

```

This is how i am creating/calling `myApp` in controller.

**Controller**

```
angular.module('myApp', []).controller('motorController', function ($scope, motorService) {

 //////
}

```

This is how i am trying use myApp in my service. but it gives error `myApp is undefined.`

**Service:**

```
myApp.service('motorService', ['$http', function ($http) {
//////
}

```

and this is how i declared it in my html

```
<html ng-app="myApp">

```

Looking forward for some help.
Thanks