I am really interested in Js MVC framework like Ember but in many places.
I read that ember is used for one page web application.
I have some confusions.
Can I use ember for large scale application having lots of pages?
If I can't then which MVC framework is best for large applications.
Suggest your ideas...
I am really interested in Js MVC framework like Ember but in many places.
I read that ember is used for one page web application.
I have some confusions.
Can I use ember for large scale application having lots of pages?
If I can't then which MVC framework is best for large applications.
Suggest your ideas...
javascript
jquery
ember.js
Share
Improve this question
edited Jan 9, 2014 at 7:58
KesaVan
1,0311616 silver badges3333 bronze badges
asked Jan 9, 2014 at 7:53
user3176531user317653188311 gold badge66 silver badges77 bronze badges1
See the answer of Srihari, I only like to add: technically it is a single application page that is served to the client. Also see: en.wikipedia/wiki/Single-page_application
– DelphiLynx
CommentedJan 9, 2014 at 8:05
Add a ment
|
3 Answers
3
Reset to default
3
No JS MVC Framework would be written aiming at one page web application. As per Ember's own website, http://emberjs./#routing-example
Ember.js makes it downright simple to create sophisticated, multi-page JavaScript applications with great URL support, in a fraction of the code you'd write in other frameworks.
So to answer your questions:
Yes.
All JS MVC frameworks listed at http://todomvc./
One can use Ember.js with or without the Ember.Router. If the application doesn't need to change the browser's address bar, the following will setup a basic, one "page" Ember installation.
Given the following code:
var App = Ember.Application.create({
// Append application to a selector
rootElement: '#ApplicationView'
});
App.Router = Ember.Router.extend({
// Set the default location
location: 'none'
});
App.Router.map(function() {
// Set the default path to home
this.resource('home', { path: '/' });
});
App.ApplicationRoute = Ember.Route.extend({
init: function() {
console.log("Application route initialized");
}
});
The One page web application term technically does not apply to Ember. It relies on the URLs being the fundamental driving force behind rendering or display of views.
For instance if you had a webpage located at /home and another webpage located at /search - you would accordingly wire up Ember's route to set up the controllers, routes and views accordingly. Each template can be organized and named according to Ember's naming conventions
if you want the page /home in your app, you will have the following (adapted from http://coding.smashingmagazine./2013/11/07/an-in-depth-introduction-to-ember-js/):
a home template,
a HomeRoute,
a HomeController,
and a HomeView.
Similar question here - Is Ember really a single page app?