TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Ember Tutorial

127 点作者 hpvic03将近 11 年前

7 条评论

rubiquity将近 11 年前
The more I look at Ember the more it reminds of a framework named Batman[0] I used over two years ago. It&#x27;s almost a complete replica, all the way down to Ember.Object being identical to Batman.Observable.<p>The problem with Batman (aside from being buggy) was that it tried to do this same MVC that we use on the server on the client, and the mapping just doesn&#x27;t make sense. HTTP &quot;MVC&quot; doesn&#x27;t have state between requests whereas client-side MVC has state for the entirety of the app. Rails, for example, has a Router and Controller due to the synchronous nature of how a request comes in and gets turned into a response. The first place I see MVC JS frameworks fall apart is when they have both Controllers and Routers. Ember Controllers look like little more than Decorators. I imagine these would be called a ViewModel if named appropriately.<p>Over two years later, I can&#x27;t help but feel Backbone (minus the underabstracted View layer, which can be easily replaced with React) got the mental model for JavaScript apps right from the start.<p>Ember just seems to have been marketed much better than Batman was, which is no surprise, Yehuda is good at doing that.<p>0 - <a href="http://batmanjs.org" rel="nofollow">http:&#x2F;&#x2F;batmanjs.org</a>
评论 #7884168 未加载
评论 #7885805 未加载
评论 #7885227 未加载
评论 #7884494 未加载
评论 #7884144 未加载
chrishenn将近 11 年前
I&#x27;ve been working with Ember over the past few months and am still impressed with how simple and productive it makes every day tasks. Basic CRUD stuff, especially render code, is a lot less drudge work. I&#x27;m even more excited for where the community is leading the framework, through projects like ember-cli and htmlbars.<p>Ember is conceptually pretty massive though. A tutorial like Michael Hartl&#x27;s Rails tutorial would be a huge benefit, it looks like that&#x27;s what this is aiming for. Thanks!
评论 #7884221 未加载
评论 #7883995 未加载
TheBrockEllis将近 11 年前
As a new comer to Ember, I am quite confused as to the necessity of the Rails portion of the tutorial. I read through the intro and the first chapter and all I could gather was that it was for the &quot;back end&quot;. I really wish there was a great, up-to-date tutorial that was back-end agnostic so that newbies don&#x27;t have to possibly learn two new frameworks at once.
评论 #7884122 未加载
pyre将近 11 年前
My favourite Ember (Data) quirk:<p><pre><code> this.get(&#x27;store&#x27;).createRecord(&#x27;ModelName&#x27;, { .. attrs .. }).save().then(function (model) { &#x2F;&#x2F; Ember.isNone(model) === true }, function(error) { console.error(error); }); </code></pre> The fix: s&#x2F;ModelName&#x2F;modelName&#x2F;<p>This works sometimes, and not others. The only indication of failure is the fact that the model is not loaded from the JSON response to the POST&#x2F;PUT request. It&#x27;s a subtle bug. I wasted a bunch of time tracking this down through the Ember Data internals (for a co-worker, but the original bug&#x2F;typo could easily have been mine).<p>The other quirk is converting snake case to camel case and back:<p><pre><code> address_1 =(to camelcase)=&gt; address1 =(to snakecase)=&gt; address1 </code></pre> Oops! We only use capital letters to determine where underscores go! ;-)
评论 #7885065 未加载
cocoflunchy将近 11 年前
You shouldn&#x27;t use Monaco as your only font for your pre and code elements. It comes up as sans-serif on windows and linux...
评论 #7884891 未加载
basiliothecat将近 11 年前
Just finishing my first app using Ember and don&#x27;t think that i&#x27;ll go that route again. Speaking of which - this controller-route separation feels a bit unnatural. At least the way it&#x27;s implemented.<p>There are lots of good parts to it - that same convention of configuration saves lots of boilerplate, data binding is usually really nice, overal separation of concerns when doing it ember-way is rather good (far from great though), but lots of small nuisances here and there make up for a dubious overall experience.
ulisesrmzroche将近 11 年前
Good work, bro! Main criticism is that the 1st chapter took forever though.