Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>If you're using Angular 1.2.x, see <a href="http://docs.angularjs.org/api/ng.directive:ngFocus" rel="noreferrer"><code>ng-focus</code></a> and <a href="http://docs.angularjs.org/api/ng.directive:ngBlur" rel="noreferrer"><code>ng-blur</code></a>:</p> <pre><code>&lt;div ng-class="{xyz: focused}"&gt;Enter your name here&lt;/div&gt; &lt;input type="text" ng-model="user.name" ng-init="focused = false" ng-focus="focused = true" ng-blur="focused = false" id="name" required&gt; </code></pre> <p>If you're using a 1.0.x version, nothing is stopping you from defining your own <code>focus</code> and <code>blur</code> directives based on <a href="https://github.com/angular/angular.js/blob/b891c708cf1a19dc0744649547d6499f9d217e01/src/ng/directive/ngEventDirs.js#L38" rel="noreferrer">Angular 1.2.x's</a>:</p> <pre><code>/* * A directive that allows creation of custom onclick handlers that are defined as angular * expressions and are compiled and executed within the current scope. * * Events that are handled via these handler are always configured not to propagate further. */ var ngEventDirectives = {}; forEach( 'click dblclick mousedown mouseup mouseover mouseout mousemove mouseenter mouseleave keydown keyup keypress submit focus blur copy cut paste'.split(' '), function(name) { var directiveName = directiveNormalize('ng-' + name); ngEventDirectives[directiveName] = ['$parse', function($parse) { return function(scope, element, attr) { var fn = $parse(attr[directiveName]); element.on(lowercase(name), function(event) { scope.$apply(function() { fn(scope, {$event:event}); }); }); }; }]; } ); </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload