Skip to content

first page

pierr edited this page Oct 23, 2014 · 5 revisions

In order to write you first page, you have two options: use the page generator or write a page on your own. This tutorial will follow the rules describe here The use case is what follows: I want to display/edit a contact page in my application.

On your own

Your page needs a route inside a router

In the app/routers/{yourRouterNameFile}, you have to write a new route.

//Dependencies.
var Router = Fmk.Helpers.Router;
var application = require('../application');
var NotImplementedException = Fmk.Helpers.CustomExceptions.NotImplementedException;
/**
 * Router dealing with the modul contact.
 * @module  'app/router/contact'
 */
module.exports = Router.extend({
  /**
   * Routes du module messgae.
   * @type {Object}
   */
  routes: {
    'contact/:contactId': 'contactDetail',
  },
  /**
   * Route dealing with the contact detail.
   * @return {undefined}
   */
  contactDetail: function contactDetailRoute(contactId) {
      throw new NotImplementedException("contactDetailRoute");
    }));
  }
});

Using the generator

Clone this wiki locally