$ npm install
$ gulp
This app has a basic modular system. You can write your own modules and put a routes.js file in it that will be used when loading application. See app.js for view how it works.
mkdir -p app/modules/test/controllers app/modules/test/views
var Test = {
controllers: {
TestHomeCtrl: require('./controllers/TestHomeCtrl')
},
routes: require('./routes')
};
module.exports = Test;
Tells to your app about routes handled by your module
'use strict';
function Routes($routeProvider) {
$routeProvider.
when('/test/', {
templateUrl: 'modules/test/views/home.html',
controller: 'TestHomeCtrl'
}).
otherwise({
redirectTo: '/'
});
}
module.exports = Routes;
controllers/TestHomeCtrl.js
'use strict';
function TestHomeCtrl () {
//
console.log('TestHomeCtrl');
}
module.exports = TestHomeCtrl;
views/home.jade
| test-home.html
To do this, edit app.js
. In future release, Gulp should do this for you!
// initializing modules
var modules = {
rooms: require('./modules/rooms'),
// Here, add your module
test: require('./modules/test')
};
- Modularization with advanced and automatic routing.
- I18n
- Menu that takes each module that allows "menu publication" and create entries combining with route-table
- Require-all module for browserify
- A better documentation
- Other...