I have an ember.js application. It has two routes: main page and service page.
App = Ember.Application.create();
App.Router.map(function() {
this.resource('index', { path: '/' }, function() {
this.resource('service', { path: 'services/:slug' });
});
});
When users go to service page an url changes from http://example.com/ to http://ift.tt/1DgJPCy. Then, when users refresh page, the service page opens. And I need to open the index page after refresh. How can I do that? Now I have a navigation menu that created with "link-to" helper in template.
{{#each service in model}}
{{#link-to 'service' service classNames='list-group-item'}}
{{service.name}}
{{/link-to}}
{{/each}}
Maybe, it is possible to create links without hashes, then after refresh the main page would be opened.
Aucun commentaire:
Enregistrer un commentaire