var myApp = angular.module( 'myApp', [] ); myApp.controller( 'MyCtrl', [ '$scope', function ( $scope ) {}]);
<div ng-controller="MyCtrl"> <input type="text" placeholder="Focus me!" ng-focus="focused = true" ng-blur="focused = false" /> <pre ng-show="focused">I'm focused!!!</pre> </div>