I get the following error when adding a directive to my site:
Error: [ng:areq] Argument \'MainController\' is not a function, got undefined
The
passing a 2nd argument like this angular.module('my-app', []) creates a new module, use it only once.
angular.module('my-app', [])
To retrive a module use var module = angular.module('my-app') and use module.controller(... or module.directive(.... etc.,
var module = angular.module('my-app')
module.controller(...
module.directive(....