title: Is it possible to use Protractor to test the value of a variable not model-bound to the DOM?
body: <p>I'm relatively new to Angular and new (today) to Protractor, so I'm not exactly sure how to ask this question - thus I not quite sure if there is a duplicate out there. Below is a very simplified version of a much larger, much more complex application we are developing, but the basic idea is the same.</p>
  
  <p>Let's say I have a simple web page:</p>
  
  <pre><code>&lt;input id="my-input" ng-model="myValue"&gt;
  &lt;button id="submit-button" ng-click="doSomething()"&gt;
      Click Me
  &lt;/button&gt;
  </code></pre>
  
  <p>Controlled by a simplified angular app:</p>
  
  <pre><code>// some-angular-app.js
  
  $scope.myValue = "";
  $scope.computedValue = null;
  
  $scope.doSomething = function() {
      $scope.computedValue = "Hello World";
  }
  </code></pre>
  
  <p>Essentially, when you click on the button, it triggers a function which manipulates variables in your app. In our case (as above), the variables (i.e. <code>$scope.computedValue</code>) are not bound to the DOM in any way - they are actually compiled and passed to a JSON request to be consumed by our API. However, I want to test those values -- something like:</p>
  
  <pre><code>// some-protractor-test.js
  
  describe('form submission', function() {
      it('should corretly set the computed value', function() {
          browser.get('http://our.awesome-web.page');
          element(by.css("#my-input")).sendKeys("Hello Input");
          element(by.css("#submit-button")).click();
  
          // ??? how to check that computedValue === "Hello World" ???
      });
  });
  </code></pre>
  
  <p>Is is possible to use Protractor to check the state of our data in this manner, or must all interaction with the Angular app be handled through DOM elements?</p>