Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ember is only for one page website?

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.

  1. Can I use ember for large scale application having lots of pages?

  2. If I can't then which MVC framework is best for large applications.

Suggest your ideas...

like image 930
user3176531 Avatar asked Mar 21 '23 01:03

user3176531


2 Answers

No JS MVC Framework would be written aiming at one page web application. As per Ember's own website, http://emberjs.com/#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:

  1. Yes.
  2. All JS MVC frameworks listed at http://todomvc.com/
like image 136
Srihari Avatar answered Mar 27 '23 13:03

Srihari


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>
like image 30
rxgx Avatar answered Mar 27 '23 14:03

rxgx