ng-if Else in Angularjs

Today i am going to share the code sample for angularjs ng-if else conditional Expression.

The angularjs not provide the if() {} else{} condition like others but we can achieve it by using the module.It is a collection
of control flow directives like:
 
1. ng-if 
2. ng-if-else
3. ng-else 
 
Example Code Sample  
  1. <!DOCTYPE html>  
  2. <html>  
  3.   
  4. <head>  
  5.     <script src="http://code.angularjs.org/1.2.0-rc.2/angularjs.js"></script>  
  6.     <script>  
  7.         function mainController($scope)   
  8.     {  
  9.             $scope.data =   
  10.             {  
  11.                 FName: 'Yogendra',  
  12.                 LName: 'Yadav'  
  13.             };  
  14.         }  
  15.     </script>  
  16.   
  17.     <body ng-app>  
  18.         <div ng-controller="mainController">  
  19.             <h2>ng-if else in angularjs</h2>  
  20.             <div>  
  21.                 <div ng-if="data.FName==='Yogendra'">  
  22.                     Employee Name: {{FName}} {{LName}}  
  23.                 </div>  
  24.                 <div ng-if="data.FName===' '">  
  25.                     Sample Code  
  26.                 </div>  
  27.             </div>  
  28.         </div>  
  29.     </body>  
  30.   
  31. </html>