title: Selecting by text with Protractor
body: <p>I am mostly familiar with java selenium, and I am new to both JS and Protractor. Lets say I am trying to click an option from a list of options with a common identifier..</p>
  
  <pre><code>var options = $('.options');
  </code></pre>
  
  <p>How could I get all elements with that common identifier, and then select one by its text? I can not do driver.findElements like I could in java since there is no reference to driver..</p>
  
  <p>This is what I have tried so far but its not working and I think its due to my inexperience with JS</p>
  
  <pre><code>this.selectCompanyCode = function(companyCode) {
      dropDownMenus[0].click();
      var companyCodeOptions = $('[ng-bind-html="companyCode"]');
      companyCodeOptions.filter(function (elem) {
          return elem.getText().then(function text() {
              return text === companyCode;
          });
      }).first().click();
  };
  </code></pre>