title: How To Add This Format Function In AngularJS
body: <p>I have a call in AngularJS to $http Get which is returning data.  I have a boolean field PassFail that currently appears as "true" or "false".  I want it to display "Pass" or "Fail".  I've tried adding a PassFail function in $scope and $rootScope but nothing works for me.  I think there is some easy solution but it will probably take me days to figure this out on my own.  Can you help?</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>    var oApp = angular.module("myApp", []);
  
      oApp.controller("certificationsCtrl", function ($scope, $http)
      {
          $scope.Exams = {};
  
          $scope.GetPassFail = function (passFail)
          {
              return passFail ? "Pass" : "Fail";
          };
  
          $scope.ShowExams = function (certificationID)
          {
              var url = "http://localhost:49861/api/Exams?id=" + certificationID + "&amp;extra=0";
  
            $http({
                  method: "GET",
                  url: url
              }).then(function mySuccess(response)
              {
                  $scope.Exams = response.data;
              }, function myError(response)
              {
                  alert("error response.statusText = " + response.statusText);
              });
          }
      });
  
  &lt;tr ng-repeat="x in Exams"&gt;
                  &lt;td style="border: 1px solid black;"&gt;{{ x.ExamNumber}}&lt;/td&gt;
                  &lt;td style="border: 1px solid black;"&gt;{{ x.ExamShortName }}&lt;/td&gt;
                  &lt;td style="border: 1px solid black;"&gt;{{ x.PassFail | GetPassFail }}&lt;/td&gt;
  MM-dd" }}&lt;/td&gt;
              &lt;/tr&gt;</code></pre>
  </div>
  </div>
  </p>