What is the role of the router in a single-page application?

I'm new to Ember-js, I recently looked at some blog posts, and also saw a video with the message Ember-js from Tom dale.

to say that Router Api has recently been introduced, and this is the best thing that has happened with Ember-js, Router Api is used to control the state of the application, and each state is identified with a URL, now for one page an application in which we use only one URL address, what is the role of the router, will there be only one routing entry that maps to "/" (index)? If so, then we are losing the advantage provided by the api router, right?

+5
source share
1 answer

, URL-, , , '/' (index)?

- URL-. , url gmail. , , URL-. gmail, URL-, . ember .

, , api, ?

URL-, , "/" , . "none"

. http://emberjs.com/guides/routing/specifying-the-location-api/

, , , , gmail, , , ?

, . , ( ) . , gmail, , .

URL- GMail: https://mail.google.com/mail/u/0/?shva=1#inbox

// Gmail Routes:
* /mail - the mail application
* /u/0 - connected account index 0 for the current user
* ?shva=1 - http://stackoverflow.com/questions/1692968/what-is-shva-in-gmails-url
* inbox - folder name

EmberMail: https://mail.ember.com/mail/u/0/inbox

// EmberMail Routes
this.resource('mail', { path: '/mail' }, function() {
  this.resource('currentUser', { path: '/u' }, function() {
    this.resource('account', { path: '/:account_id' }, function() {
      this.route('folder', { path: '/:folder_id' });
    });
  });
});

, ?

, , - . , ember ember-:

+4

All Articles