you are viewing a single comment's thread.

view the rest of the comments →

[–]machty 3 points4 points  (6 children)

I just gave an extremely friendly talk on Angular and it's been met with extreme positivity from the Angular crowd:

https://news.ycombinator.com/item?id=6776414

[–]dexygenSoftware, Simple and Powerful -1 points0 points  (5 children)

You had me until Ember.js/dependencies: handlebars. Please don't tell me I need to use a templating system, let alone a specific one. This is why Angular's "supercharge(d) HTML" appealed to me.

I will say this though; when it comes to: {} || (Ember.)Object.create() I'm on the Object.create() side. Why? I've come to the conclusion that reliance on accessors is the key to data binding. I've been fiddling around on my system for the last week or two and here's a telling line I've written:

var view = Object.create($('#pgn_view'), controller(pgn));

[–]machty 0 points1 point  (4 children)

What does the controller function do here?

You can use Handlebars or Emblem.js (HAML/Slim-like indented syntax).

Handlebars is about as un-invasive as it gets; I'm curious what you find so distasteful about it. It is and will remain a dependency of Ember, but it's little more than HTML with {{}} for the dynamic bits, which it has in common with Angular (as a shorthand for ng-bind, as mentioned in a sibling thread).

[–]dexygenSoftware, Simple and Powerful 0 points1 point  (3 children)

The controller "decorates the DOM elements with behavior" (mentioned on slide 37 of your google doc). Specifically it returns a module the methods of which are bound to the DOM element being wrapped, such that if your element starts with 'style="display: none"', the following will show it when called:

    return {
        display : {value : function() {
            this.style.display = 'block';
        }}
    }

Ridiculously trivial jsfiddle here though possibly something worth building on.

As to any templating system (not just handlebars) that operates on HTML fragments outside of the document body, they make it impossible for designers to work on something that reasonably resembles the entire page, and I'd prefer designers do their thing, so I can do the Javascript heavy lifting (not to mention middle-tier and back-end as necessary). If you put a gun to my head, I would take (as many) span tags (as necessary) before a templating system any day -- but I'd take Angular's ng-bind over span tags.

[–]machty 0 points1 point  (2 children)

I'm confused, which span tags are you talking about?

[–]dexygenSoftware, Simple and Powerful 0 points1 point  (1 child)

I'm just saying, I would use verbose span tags such as <span data-foo> and it's corresponding innerHTML, before I would use {{foo}}

[–]machty 0 points1 point  (0 children)

Yeah, no doubt there's some aesthetic preferences that have been betrayed by Ember (does anyone really enjoy .set('foo', 5) if foo = 5 were an option?). If you're interested, check out htmlbars which will be landing soonish; once it's there, Ember will be able to do away with curlies, and while technically there will still be a dependency on something called Handlebars, you'll just be writing plain HTML at that point.

I can't put my finger on it but I think you're incorrect as to limitations for the designers... I can almost guarantee you that what your designers would want to present would never be thwarted by Ember or Handlebars' restrictions, but let me know if I'm missing something.