I want to seperate my WebApp in different modules for directives, services, controllers etc. just like angular-seed. Somehow the controllers defined in controllers.js don't seem to work.
<ul class="menu" ng-controller="MenuController">
<li>{{hello}}</li>
</ul>
In app.js I defined the global App module with it's submodules.
// Declare app level module which depends on filters, and services
angular.module('myApp', [
'myApp.filters',
'myApp.services',
'myApp.directives',
'myApp.controllers'
]);
And in controllers.js I tried to define a controller, that does not load. When the page get rendered I just see {{hello}}.
angular.module('myApp.controllers', []).
controller('MenuController', function($scope) {
$scope.hello = "world";
});
How do I attach the controllers to their template counterparts?
controllers.js:function MenuController($scope){ $scope.hello = "world"; }it works..beforeapp.js