There are several issues with the fiddle:
1) need to specify that you want to use the AngularJS framework (I selected
"No wrap - in <head>")
2) module name must match value of ng-app directive (I changed it to just
"iShareApp")
3) jqLite elements don't have a focus method, but DOM elements do, so use
element[0].focus()

<body ng-app="iShareApp">
  Hello world!!!
  <input focus>
</body>

var directives = angular.module("iShareApp", []);

directives.directive("focus",
  function () {
  return {
  link: function (scope, element, attrs) {
  element[0].focus();
  }
  };
});

Let me know if those changes don't fix it for you.


On Sun, Feb 2, 2014 at 3:38 PM, Marc B <[email protected]> wrote:

> Here is the code I use... the element the ng-bind is attached to is not
> being focused.
>
> http://jsfiddle.net/fiddlerMan_22/zHfvK/
>
> Maybe someone can tell me what's wrong...
>
> --
> You received this message because you are subscribed to the Google Groups
> "AngularJS" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/angular.
> For more options, visit https://groups.google.com/groups/opt_out.
>



-- 
R. Mark Volkmann
Object Computing, Inc.

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to