title: List all declared $scope variables of angular
body: <p>I have a simple angular snippet </p>
  
  <pre><code>&lt;div ng-app="myApp" ng-controller="myCtrl"&gt;
  
  &lt;input ng-model="name"&gt;
  
  &lt;h1&gt;My name is {{name}}&lt;/h1&gt;
  
  &lt;/div&gt;
  
  &lt;script&gt;
  var app = angular.module('myApp', []);
  
  app.controller('myCtrl', function($scope) {
      $scope.name   = "John Doe";
      $scope.age    = "26";
      $scope.height = "5.9";
      $scope.gender = "M";
  
  });
  &lt;/script&gt;
  </code></pre>
  
  <p>As you can see I have 4 variables declared in my <code>myCtrl</code> controller</p>
  
  <pre><code>$scope.name   = "John Doe";
  $scope.age    = "26";
  $scope.height = "5.9";
  $scope.gender = "M"; 
  </code></pre>
  
  <p>Is there a way to programmatically list of all the declared <code>$scope</code> variables of a specific angular controller? </p>
  
  <p><strong>Why am I trying to do this ?</strong> </p>
  
  <p><em>Sometimes, when you’re deep in 1000 lines of code in an angular controller, it will be very helpful to know what are the available variables to use at that specific moment. First, the benefit would be, so we don’t re-declare something that already been declared, and second, so we don't override an existing variable unintentionally. For those 2 reasons alone, that's why I am trying to list all the available <code>$scope</code> variables, especially the one that I declared in on that specific page, or in a specific controller of Angular.</em></p>
  
  <blockquote>
    <p><strong>NOTE</strong> : I am <code>NOT</code> looking to list all JS scope variables, but only looking for those one that I declared in Angular</p>
  </blockquote>