ng-if else的使用
<!DOCTYPE html> <html> <head> <script src="http://code.angularjs.org/1.2.0-rc.2/angularjs.js"></script> <script> function mainController($scope) { $scope.data = { FName: 'Yogendra', LName: 'Yadav' }; } </script> <body ng-app> <div ng-controller="mainController"> <h2>ng-if else in angularjs</h2> <div> <div ng-if="data.FName==='Yogendra'"> Employee Name: {{FName}} {{LName}} </div> <div ng-if="data.FName===' '"> Sample Code </div> </div> </div> </body> </html>