admin管理员组文章数量:1418687
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...
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
3 Answers
Reset to default 3No 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 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?
本文标签: javascriptEmber is only for one page websiteStack Overflow
版权声明:本文标题:javascript - Ember is only for one page website? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745290416a2651759.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论