Friday, February 17, 2017

EmberJS - Router

Introduction

This is the core feature of the EmberJs. The router is used to translate URL into the series of templates and also it represents the state of an application. The EmberJs uses the Hashchange event that helps to know change of route, this can be done by implementing HashLocation object.

Logging Route Changes

As an application grows in complexity, the logging route keeps track of the router.

ENV.APP.LOG_TRANSITIONS = true;
The above code translates transition events to the log modifier.

Specifying a Root URL

If the EmberJs domain have the multiple web application, In that case you need to specify the root URL to indicate the router.
Ember.Router.extend({
  rootURL: 'Path'
});
The above code describes how to specify the root URL. The 'path' is root URL path.
Let us see some more details about routers by clicking the below links:

No comments:

Post a Comment