We can make use of Angular directives to make use of this functionality. AngularJS provides ng-init ( Initiate variable here ), ng-focus ( Trigger event when input got focus ),  ng-blur ( Trigger event when input lost focus )

Program Flow

  1. ng-init : Initiate focus variable as false
  2. ng-focus : Set true to the focus variable
  3. ng-blur : Set false to the focus variable
  4. Use focus variable to check focus

Markup

<h4>Focus and UnFocus below Text filed</h4>
<input ng-init="myFocusVar = false"  ng-focus="myFocusVar = true" ng-blur="myFocusVar = false"/><br>
<h4>Focus result</h4>
<div class="red" ng-bind="myFocusVar">
  This text color can be changed by class
</div>

3 comments:

  1. Check whether the input field has the focus or not using angularJS. Basically, through the topic author describe all the summary about the whole mention on https://www.analyzedu.com/writing-services-reviews/trustmypaper-com-review.html. This time we have to make it more things which are really necessary for us all the time.

    ReplyDelete
  2. No, really, studies have shown that men’s brains are simpler than women’s. They are not as capable at multi-tasking or processing loads of information as quickly as women. (Don’t know where I am getting this from but I remember reading it somewhere once… or maybe I just made it up). Albanian women

    ReplyDelete
  3. Your blogs are great.Are you also searching for Nursing evidence-based practice writing services ? we are the best solution for you. We are best known for delivering the best nursing writing services to students without having to break the bank.

    ReplyDelete

Blogroll

Popular Posts