Am I forced to use a single-page design?


#1

I am working on my first Ember app and everything was going well. It’s a basic blog. I had an admin section for adding, editing, and deleting records and an end-user section that didn’t use Ember.

I’m now trying to mix the two so that I can edit content directly from the end-user page. I still want my end-user code to be regular-old HTML - not handlebar templates that render content. I want to add handlebar templates to different parts of the page for the interactive components. For instance, put a login link in the upper right hand corner, show a form for editing content for logged-in users, etc. However, it looks like you can’t really use Ember that way. It appears that you have to use one section of the page for all the handlebar templates. You can separate them and place views in different parts of the page.

I tried using “replaceIn” but I have not had any luck getting it to work.

Can anyone point me in the general right direction? I’ve hit a brick wall.


#2

I haven’t tried it myself. But I think it’s possible. Take a look at http://emberjs.com/api/classes/Ember.Application.html#property_rootElement

And then make sure to turn off location in your router like this:

App.Router.reopen({
    location: 'none'
});

#3

I am currently building up a regular webapp (Grails backend), with three different Ember applications embedded. Two of them are directories on which the user can navigate through categories, apply filters, add favorites and display detailed view of each items. The other is for editing the directory’s items.

Each Ember applications are restricted to the central part of the regular webapp layout (made of a header and a footer). Authentication, and all other pages are managed in the old-fashioned way. I do use the rootElement option to restrict the playground for Ember.

For my part, I did not have to disable the location handling of the router as the only last part of the url is managed by the Ember router.