Skip to content

04 Configuration

Dan ford edited this page Jan 17, 2016 · 3 revisions

The available options to configure are the following with their defaults:

{
  DEBUG: true,
  useHistory: false,
  loggingLevel: 'LOW'
}

DEBUG - Global

This option will log all of the issues that are encountered by Ractive and the Router. By default this will only log a minimal amount of issues i.e. the important ones. By saying that this option is global we mean that setting the DEBUG option will manually configure all instance of the Router.

useHistory

If this is set to true, then if the History API is available then the framework will stop listening for hashchange events and start start using pushState. This will allow you to remove the hash from all of your links.

If you are not using history, in your HTML, you will have to link to pages by having the hash present in the href.

Example

<a href="#/blog">To the blog!</a>

Note: If you want to use the history API you will need to have your site correctly set up so that it can handle the page correctly on refresh.

loggingLevel

By default this is set to LOW, so it will only tell you about the issues that we feel you should know. However, if this is set to HIGH then everything in the Router will be logged.

Clone this wiki locally