Cons:
Pros:
Require
var angular = require('angular');
angular.module('app', [])
Bundling
Transforms
app/
--- cats/
|--- index.js
|--- cats-ctrl.js
|--- cats-config.js
|--- cats.html
--- unicorns/
|--- index.js
|--- unicorns-ctrl.js
|--- unicorns-config.js
|--- unicorns.html
|--- unicorns-add/
--- components/
|--- unicorn-directive/
|--- index.js
|--- unicorn-dir.js
|--- unicorn.html
var angular = require('angular');
module.exports = function( $stateProvider ) {
$stateProvider
.state('unicorns', {
url: '/unicorns',
controller: 'unicornCtrl',
template: require('./unicorns.html') // Using partialify
});
};
var angular = require('angular');
module.exports = angular.module('unicorns', [
require('../components/unicorn-directive/').name
])
.config( require('./unicorn-conf.js') )
.controller( 'unicornCtrl', require('./unicorn-ctrl') );
var angular = require('angular');
angular.module('app', [
require('./unicorns').name,
require('./cats').name
])
.config( function( $urlRouterProvider ) {
$urlRouterProvider.otherwise('/');
});