News for hackers. Stuff that matters.
Re:Why does Angular.js rock? by hayksaakian on Saturday August 03, 2013 @03:58PM (#6153153)

    It works great but what if we want the input to have the focus when the page loads? jQuery right? We grab the input and we call the focus() method in it. NO.

    With directives we want our HTML to be as self-descriptive as possible so we are going to create a focus directive.
Or you could use html5's autofocus

http://davidwalsh.name/autofocus

and cut the JS

-----

Otherwise great article, I'm really leaning hard towards angular now, over ember

Re:Why does Angular.js rock? by Foxandxss on Saturday August 03, 2013 @04:23PM (#6153243)
True, but the directive will reach to those places where html5 is not a welcome guest.

But to be sincere, I picked one thing to a directive, there are infinite ideas but I needed one easily enough for a "hello-world" type of post.

Re:Why does Angular.js rock? by hayksaakian on Monday August 05, 2013 @02:50AM (#6158772)
Is there some way to make a shim with angular, that only applies the directive if autofocus is not supported