>
> I would expect var angular = require('angular') to work. And then module 
> dependencies via var dependecies = [require('foo').name, 
> require('bar').name].
>

Then only thing that is bothering me right now with browserify and angular 
is the clash between DI and CommonJS.

Personally I put my DDO inside my index.js and there set up my 
angular-specific code and names. 
// Inside a folder named mn-menu

var moduleName = 'mnMenu'
var controllerName = moduleName + 'Controller'
var dependencies = []
angular.module(moduleName, dependencies).directive(moduleName, function (){
  return {
    template: require('./template.html'),
    controller: controllerName
  }
})
  .controller(controllerName, require('./controller'))

If I do a folder for mn-footer, then I just copy that and replace the 
folder-name and the variable moduleName to 'mnFooter'. Everything else 
remains the same.

That's how I use it right now. 
Angular becomes the boilerplate code and my controller/factories become 
normal functions with DI that are exported via CommonJS.

>  
>

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to