Git Product home page Git Product logo

angular-browserify-gulp-boilerplate's Introduction

angular-browserify-gulp-boilerplate

Quick start

$ npm install
$ gulp

Modules

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.

Adding a Module

Create a folder tree inside app/modules:

mkdir -p app/modules/test/controllers app/modules/test/views

create a index.js file containing:

var Test = {
  controllers: {
    TestHomeCtrl: require('./controllers/TestHomeCtrl')
  },
  routes: require('./routes')
};

module.exports = Test;

routes.js

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;

Controller! One for each page you wanna route

controllers/TestHomeCtrl.js

'use strict';

function TestHomeCtrl () {
  //
  console.log('TestHomeCtrl');
}

module.exports = TestHomeCtrl;

views

views/home.jade

| test-home.html

Add this module to the chain loader!

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')
};

TODO

  1. Modularization with advanced and automatic routing.
  2. I18n
  3. Menu that takes each module that allows "menu publication" and create entries combining with route-table
  4. Require-all module for browserify
  5. A better documentation
  6. Other...

angular-browserify-gulp-boilerplate's People

Contributors

brugnara avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.