简体   繁体   中英

Using Ember.js for some views only with Rails

I have Rails app which I would like to implement Ember.js with.

I just want this to be used with some pages/views and not all of them.

I tried to do some but it seems javascript is being rendered afterwards (which is predicted) so when I render a partial view, it doesn't get rendered inside but rather just before body's closing tag.

Is there a good way to structure this or should I use the entire view to run with Ember.js?

You can set the rootElement when you create your Ember app to tell Ember where to embed the app.

App = Ember.Application.create({
  rootElement: "#emberMain"
});

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM