Ng-Blur-5

 

In this example, We have added ng-focus on radiobuttons one is for male and another one is for female. See the code

 
 
 
<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title></title> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.2/angular.min.js"></script> <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css"> <style> .blur { color: white; border-radius: 3px; background-color: maroon; padding: 8px; margin: 8px; } </style> </head> <body ng-app="app"> <div class="container"> <div ng-controller="LearnKode"><br /> <div class="row" ng-init="male='Male';isMaleBlur=true"> <label class="col-md-2">Gender :</label> <div class="col-md-2"> Male <input type="radio" name="blur" ng-focus="isMaleBlur=true" value="Male" ng-model="male"> Female <input type="radio" name="blur" ng-focus="isMaleBlur=false" value="Female" ng-model="female"> </div> <div class="row"> <div class="col-md-8"><br /> <span class="blur">{{isMaleBlur==true?"Female":"Male"}} is blur.</span> </div> </div> </div> </div> </div> <script> var app = angular.module("app", []); app.controller('LearnKode', ['$scope', function ($scope) { }]); </script> </body> </html>
Output