|
|
|
|
|
by hayksaakian
4696 days ago
|
|
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 autofocushttp://davidwalsh.name/autofocus and cut the JS ----- Otherwise great article, I'm really leaning hard towards angular now, over ember |
|
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.