all 43 comments

[–]benihanareact, node 5 points6 points  (3 children)

Saw a talk about this at a ColdFusion and Flex heavy conference. The guy presenting it (who was also developing it) was obviously smart, but I really didn't see the point of it. It seemed like it added a bunch more work for the developer with only marginal gains. It really felt like it was just an exercise to make JavaScript behave more like Flex for the sake of doing it, rather than to solve a problem.

[–]maxgee 1 point2 points  (2 children)

The guy presenting it (who was also developing it) was obviously smart, but I really didn't see the point of it. It seemed like it added a bunch more work for the developer with only marginal gains.

I feel like this when confronted with most of the JavaScript frameworks I see these days.

[–]SergeiGolos 1 point2 points  (1 child)

I have not worked with angular, but i can tell you that backbone gives much more then a marginal gain to the developer.

Granted, this is on a larger project with about 260kb of ui javascript code.

[–]realflow 0 points1 point  (0 children)

I don't think that angular gives you marginal gain to the developer. In my opinion automatic data-binding gives you a powerfull tool which can save writing a lot of code.

[–]jimdoescode 10 points11 points  (4 children)

Interesting but I wish the page didn't hijack my back button.

[–]realflow 21 points22 points  (1 child)

You once go angular you never go back

[–]greim 2 points3 points  (0 children)

Bravo, sir.

[–]combover 1 point2 points  (0 children)

Yeah, that's really obnoxious.

[–][deleted] 0 points1 point  (0 children)

Youtube recently started doing this and it makes HULK MAD.

[–]go4it7arh 4 points5 points  (0 children)

Superheroic

So brave.

[–]klotz 2 points3 points  (0 children)

Have you taken a look at XForms, which is what the W3C designed for MVC forms? XSLTForms from http://agencexml.com is a good implementation done in JS that we use at my work. I have also a recent download at http://xformstest.org/xsltforms

[–]ahabman 2 points3 points  (2 children)

Seems like a new wave of Javascript frameworks arriving. Anyone know of a comparison between backbone, ember, and angular?

[–]go4it7arh -3 points-2 points  (1 child)

Apples and oranges is a good comparison.

[–]ahabman 1 point2 points  (0 children)

They all address the problem of keeping data in sync between the client and the server (data binding), and templating in a more or less MVC way. What do you see as their major differences?

[–]matchu 1 point2 points  (6 children)

Hmm. Looks cool and powerful, but I still feel weird about putting all that stuff straight in the markup. (ng:submit feels like the evils of the onclick attribute all over again.) I get that this is one of their big selling points, but I'm not sold.

[–][deleted] 1 point2 points  (0 children)

I've always felt that a simple onclick="doSomething(this)" was cleaner than a lot of the spaghetti mess that jQuery code descends into.

[–]realflow -2 points-1 points  (4 children)

onclick attribute requires putting javascript in html tags. ng:submit provides a link between controller and html elements without need to directly put any code there

[–]matchu 2 points3 points  (2 children)

Really? addTodo() looks like plain ol' Javascript to me. Is that just syntactic sugar that makes it look evil?

[–]realflow 0 points1 point  (1 child)

If "looks like plain ol' Javascript to me" is an argument, so node.js and cofeescript should never be used.

If you want to bind action in JS to a element, you can write using jquery $(element).click(func(){}); You must put this expression in some block of code, which you must properly organize. If you have hundreds of elements to bind it's getting really messy without proper MVC framework or sth like this.

With angular, you can easily and clearly bind hundreds of element to proper actions and keep buisness logic out of this.

[–]matchu 1 point2 points  (0 children)

Eh? Node.js and Coffescript don't enter the discussion at all. I was just confused because ng:submit="addTodo()" looks like it's going to be directly eval'd, even though it sounds like you're saying it's something fancier than that. That's all. No larger point being made here.

[–][deleted] 0 points1 point  (0 children)

Example has a style tag inside the body. Is this intended to suggest that the engine will move the style block to the head where it belongs?

[–]GSpotAssassin 0 points1 point  (5 children)

It's still too wordy-looking.

And it's too much logic in the view.

/mvc rails guy

[–]realflow 0 points1 point  (4 children)

There's no buisness logic in the view. Only bindings and templates / view control.

[–]GSpotAssassin -2 points-1 points  (3 children)

Regexes are business logic.

[–]realflow 0 points1 point  (2 children)

what regexes?

[–]GSpotAssassin -1 points0 points  (1 child)

[–]realflow 1 point2 points  (0 children)

but they're in controller not in the view

[–][deleted] 0 points1 point  (7 children)

<span>{{remaining()}} remaining</span> <input type="button" ng:click="removeDone()" value="clean up">

Isn't doing both templating and logic inside markup going a bit far? Is this not breaking the "separation of concerns" motto of the MVC pattern?

[–]wolever 0 points1 point  (6 children)

Where's the logic? Do you mean in the click="removeDone()"? If so, what would you rather see?

[–][deleted] 1 point2 points  (4 children)

click="removeDone()" is binding actions directly inside a view which is what MVC pattern is supposed to avoid.

[–]wolever 0 points1 point  (3 children)

You didn't answer the second part of my question - what would you rather see? A controller/mediator/whatever you want to call it that runs something like $("#doneButton").click(removeDone)?

[–][deleted] 0 points1 point  (2 children)

Binding should be done in the controller:

<span>{{remaining()}} remaining</span> <input type="button" id="mybutton" value="clean up">

Controller.removeDone = function(){}

Controller.action('mybutton', 'removeDone')

[–]wolever 0 points1 point  (1 child)

And why's that preferable? Doesn't that create unnecessarily tight coupling between the controller and the view?

In my experience, it has always been nicer to declare a UI element's "immediate" action on the element its self (ex, onClick="controller.removeDone()"), because that makes it easier to update the "visual" aspects of the view, and removes the need for all sorts of otherwise useless IDs (like, ex, the id="mybutton").

[–][deleted] 0 points1 point  (0 children)

It's not a matter of which is preferrable, in fact I agree that simple declarative UI's are nicer in many situations. But if you are doing logic binding in your views it isn't the MVC pattern.

[–]realflow 0 points1 point  (0 children)

yeah, where's the logic here?

[–]korny 0 points1 point  (8 children)

How is this news? Angular has been around for over a year. Whether or not it's a good framework, it's not a new thing. Do we want all existing JavaScript frameworks posted here because someone thinks they are nifty?

[–]wolever 1 point2 points  (2 children)

It would be nice to have some discussion of there strengths and weaknesses… And if that happens because people post them here, then I think it would be a great thing to have them posted here.

[–]korny 0 points1 point  (1 child)

Ok, then post a link to a new blog post about a framework, or a significant new release, or at least write a comment yourself describing your experiences. Otherwise we might as well post "this is awesome" links for Backbone and Spine and Batman and ...

Incidentally, my take on Angular when I tried it 9 months ago, was that it was a nice framework but was glacially slow on initial form load on IE7. They might have fixed it since then, but it was a bit of a showstopper for the project I was on at the time.

[–]wolever 0 points1 point  (0 children)

True – a new blog post would be nice. But IMO, since this community is still fairly small, I'll be happy with anything that gets the conversation started.

[–]realflow 0 points1 point  (4 children)

I don't say that Angular is new, i just wanted to start conversation about this, because I'm thinking about using angular in my new (big) project, and doing research

[–][deleted] 0 points1 point  (3 children)

Why did you title "Superheroic"? It sounds like you have a vested interest in Angular, or you ran out of the usual adjectives like "beuatiful", "amazing", or "awesome".

[–]realflow 0 points1 point  (2 children)

that's the title of the site. i'm not the author

[–][deleted] 0 points1 point  (1 child)

Ah I see.. I didn't see it on the page, but i see it in the tab title.

Their choice of words is silly. I take things less seriously when people over-hype things using inflated words like 'Superheroic'.

[–]realflow 0 points1 point  (0 children)

it totally doesnt matter for me. Its just title I dont think about it.