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...
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:
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 following template:
<script type="text/x-handlebars">
<h1>Hello World!</h1>
</script>
Will be appended into our HTML page:
<div id="ApplicationView"></div>
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?