javascript - Ember is only for one page website? - Stack Overflow

I am really interested in Js MVC framework like Ember but in many places.I read that ember is used for

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...

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...

Share Improve this question edited Jan 9, 2014 at 7:58 KesaVan 1,03116 silver badges33 bronze badges asked Jan 9, 2014 at 7:53 user3176531user3176531 8831 gold badge6 silver badges7 bronze badges 1
  • 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 Commented Jan 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:

  1. Yes.
  2. 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 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?

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745290417a4620823.html

相关推荐

  • javascript - Ember is only for one page website? - Stack Overflow

    I am really interested in Js MVC framework like Ember but in many places.I read that ember is used for

    4小时前
    20

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信