title: Convert Javascript function to AngularJS function
body: <p>I wrote a simple javascript function that switches between two div elements. Like so: </p>
  
  <pre><code>function goToResults() {
      document.getElementById("services").style.display = "none";
      document.getElementById("results").style.display = "block";
  }
  </code></pre>
  
  <p>As I am learning Angular, I want to convert that to an Angular function in app.js. Can I do the following? </p>
  
  <pre><code>$scope.goToResults = function () {
      $scope.getElementById("services").style.display = "none";
      $scope.getElementById("results").style.display = "block";
  }
  </code></pre>
  
  <p>Thanks!</p>