|Re: [angular.js] Re: Focus and Blur directives?||Pete Bacon Darwin||7/9/12 1:34 AM|
I think you'll need to write a directive. Here someone has done a simplistic one: https://gist.github.com/2588075.
What are your specific requirements for these directives?
On 9 July 2012 08:48, Roy Peled <pele...@gmail.com> wrote:
|Re: [angular.js] Re: Focus and Blur directives?||Pete Bacon Darwin||7/9/12 2:19 AM|
Have you taken a look at this thread: https://groups.google.com/forum/?fromgroups#!topic/angular/0FRrPp_EsYY
On 9 July 2012 10:17, Roy Peled <pele...@gmail.com> wrote:
Actually I needed something more like the ng-click directive, which will allow me to attach a callback to a focus and blur event.
|Re: [angular.js] Re: Focus and Blur directives?||Pawel Kozlowski||7/9/12 2:40 AM|
I've wrote a quick one for ngFocus in this jsFiddle, it is really
trivial: http://jsfiddle.net/xtcST/2/ responding in this thread:
|Re: [angular.js] Re: Focus and Blur directives?||Pawel Kozlowski||7/9/12 12:48 PM|
On Mon, Jul 9, 2012 at 8:55 PM, ethermal <endot...@gmail.com> wrote:
> Not trying to hi-jack the thread, but in the directive in your fiddle I see
> a problem.
Yes, sure, you are right, as noted in the thread it was just a simple
example to show how easy is to do easy stuff :-)
you have scope.$eval(attrs.ngFocus) which calls the event
> handler but doesn't pass any information to the event handler. The event
> doesn't receive any information about the event, vital information like what
> element triggered the event, etc. So how could that information which is
> known in the directive be passed to the event handler?
In fact the complete solution is _almost_ in place in angular's source
would be great to open a pull request to add focus / blur.
The more sophisticated, custom solution would go like this (based on
the angular.js src):
In short: it would make sense to open an issue / pull request to
support focus / blur in angular.js. Otherwise it is rather easy to
implement it in a custom directive.
|Re: Focus and Blur directives?||samrec||4/13/13 4:37 AM|
This was extremely useful - found so many goodies that I would have to code myself.
On Monday, July 9, 2012 5:15:40 AM UTC-4, Sander Elias wrote:
|Re: Focus and Blur directives?||yahya Kacem||4/20/13 1:26 AM|
Actually, a simpler solution that I'm using:
Use the ngFocus(ng-focus) and the ngBlur(ng-blur) as your new directives.
Note: this is tested with angular1.1.4.
On Sunday, July 8, 2012 3:25:36 PM UTC+1, Roy Peled wrote:
Anythings about those? I can't seem to find them in the documentation.
|Re: Focus and Blur directives?||ranadheer reddy||10/1/13 4:59 AM|
|Re: Focus and Blur directives?||Jean Michel||10/1/13 3:09 PM|
|Re: Focus and Blur directives?||srikanthbattula||11/12/13 12:12 AM|
The ngBlur directive is not available in all versions so i have built a good directive on it
you can find it here directive for ngBlur
On Wednesday, July 11, 2012 2:02:10 AM UTC+5:30, ProLoser wrote:
Crap ya the syntax changed a bit quite recently. Updating the demo right now (note to self: start creating tests).