Live data from Hacker News

Ember.js or Angular.js?

news.ycombinator.com

21–30 of 104 posts

Re: Ember.js or Angular.js?

#21

Related query: I've just started with some JS MVVM frameworks, and I was wondering if any of them can "reverse bind" ie. enable you to render part of your templates on the server and utilise data from that based on a template to recreate models. The idea is to make the initial load snappy and to help with SEO (only one or two web crawlers actually execute JS afaik)

DerbyJS, Metor, or you can extend Backbone Views to read a model from the DOM on initialization if the model is empty (granted you'd have to custom code the DOM-reading parts for each model that you plan on loading this way)

Airbnb is working on something similar as well using Node+Backbone but it's not available yet. They said they're planning on open sourcing it eventually but we'll have to wait a few months. http://nerds.airbnb.com/weve-launched-our-first-nodejs-app-t...

Re: Ember.js or Angular.js?

#22

Related query: I've just started with some JS MVVM frameworks, and I was wondering if any of them can "reverse bind" ie. enable you to render part of your templates on the server and utilise data from that based on a template to recreate models. The idea is to make the initial load snappy and to help with SEO (only one or two web crawlers actually execute JS afaik)

If there is a particular data model that you want, there's no shame in just passing it directly inside the container of the view. Given a Handlebars template on the server like:

    
        {{name}}
        {{phone}}
    
They can share the same template with some minor conditional statements. The JavaScript could simply load any model(s) required from the JSON in the data attribute and re-render the view in "enhanced mode".

It comes in handy for progressive enhancement.

Re: Ember.js or Angular.js?

#23
post #9

Earlier quoted context omitted.

Looks like the peepcode screencast is paid: https://peepcode.com/products/emberjs I suppose you'll say it's well worth the money? Anyone else bought/watched this screencast?

I bought it. It was definitely worth the money.

Seconded.

Re: Ember.js or Angular.js?

#25

I have limited experience with javascript and MVMM's and cannot answer all the questions, but here is what I do know: Which is best overall? Not enough experience with ember.js to comment. Common gotchas for angular: It's a very different approach when compared to using jquery for everything. The documentation can seem a bit daunting at first, as described in the popular post about why discourse chose ember.js. "The…

Actually that's the only bit confusing part of the documentation (which now everyone is quoting to troll Angular).

Re: Ember.js or Angular.js?

#26
I tried both in similar circumstances (coming from a long backbone background), all I can say is I personally found with Ember.js (around august 2012): - more boilerplate - learning curve was much steeper. - the documentation confused me, it turned out there were many slight diferences between 0.9.xxx and 1.xxx. This "gotcha" is probably rectified by now

I tried Angular.js next (this month) and "got it" immediately: - testing is easier - writing dom manipulation is easier (ie directives) - the documentation/seed projects are great - angular-ui project is cool

In that last 6 months I imagine Ember has improved, I also feel like if I came to it now Id pick it up quicker having gone to all this effort

Re: Ember.js or Angular.js?

#27
Neither. Small modularized CommonJS files that serve the need of what you are doing is always faster to write and easier to load in your head than large frameworks that you never fully understand. Learn to use npm and use it well.

Re: Ember.js or Angular.js?

#28
I've used SC before it was Ember, hated it. I've been using Angular for a few weeks - LOVE it. It's amazingly quick to build great stuff.

I was on a Skype call with my UX designer the other day talking about how we should display a permissions list: we sent back and forwards a few different sketches, by the time we finished discussing the final sketch I had reimplemented the modal as a radio button, disabling and hiding the checkboxes when the first radio was clicked... at which point I thought, "shit, that would have usually taken 15 minutes to do".

Re: Ember.js or Angular.js?

#29

Related query: I've just started with some JS MVVM frameworks, and I was wondering if any of them can "reverse bind" ie. enable you to render part of your templates on the server and utilise data from that based on a template to recreate models. The idea is to make the initial load snappy and to help with SEO (only one or two web crawlers actually execute JS afaik)

You can pass the initial data as a json object directly with the server response.

I'm using Rails, and https://github.com/gazay/gon gem does it for you nicely.

Re: Ember.js or Angular.js?

#30
post #26

I tried both in similar circumstances (coming from a long backbone background), all I can say is I personally found with Ember.js (around august 2012): - more boilerplate - learning curve was much steeper. - the documentation confused me, it turned out there were many slight diferences between 0.9.xxx and 1.xxx. This "gotcha" is probably rectified by now I tried Angular.js next (this month) and "got it" immediately:…

> This "gotcha" is probably rectified by now

It's not. The guides published on emberjs.com apparently track the master branch on github, so are regularly out of sync with the version offered for download on the front page, and at the moment there's a third version bundled with the starter kit. This completely tripped me up when I tried to get off the ground a couple of weeks ago, because things that were described as working in the guides just didn't, and it wasn't clear what I'd got wrong.

EDIT 'cos noprocrast kicked in at the wrong moment: Add to this a release policy of stuffing new functionality in every minor release, and you've got documentation that, for someone completely new to it, who doesn't know what they don't know, feels like a minefield. The one thing you want as a beginner is documentation you can trust, and Ember just doesn't provide that yet.

To learn enough get off the ground, I ended up writing an "assume you know nothing" tutorial (https://github.com/regularfry/website/blob/master/source/gui...), which I've submitted back to emberjs.

Post reply on HN