`this` is undefined in Angular filter function used by ng-repeat
<p>I'm trying to filter an an array in the dom that uses ng-repeat. The filter works when I hard code the return, but when I try to use <code>this</code>, it gives me the error</p>

<blockquote>
  <p>Cannot read property minHeight of undefined.</p>
</blockquote>

<p>So for some reason this is undefined, but it works in other functions in the controller. I'm not sure why it doesn't work in the filter.</p>

<p>I'm sure I'm missing something ridiculously simple, but I cannot find it</p>

<p><strong>Controller</strong></p>

<pre><code>export class ItemComponent {

    /*@ngInject*/
    constructor($http) {
        this.$http = $http;
        this.minHeight = 0;
    }

   filter(row){
       console.log(this.minHeight);
       return row.minHeight &gt; this.minHeight;
   }
</code></pre>

<p><strong>HTML</strong></p>

<pre><code>ng-repeat="item in itemCtrl.items | filter: itemCtrl.filter"
</code></pre>

<p><strong>Transpiled Code (from app.bundle.js in browser)</strong></p>

<pre><code>var ItemsComponent = exports.ItemsComponent = function () {
  /*@ngInject*/
  ItemsComponent.$inject = ['$http'];
  function ItemsComponent($http) {
    _classCallCheck(this, ItemsComponent);

    this.$http = $http;
    this.minHeight = 0;
  }

  _createClass(ItemsComponent, [{
    key: '$onInit',
    value: function $onInit() {
      this.loadItems();
    }
  }, {
    key: 'loaditems',
    value: function loadItems() {
      var _this = this;

      this.$http.get('/api/items').then(function (res) {
        _this.items = res.data;
        console.log(_this.items);
      }).catch(function (err) {
        console.log(err);
      });
    }
  }, {
    key: 'filter',
    value: function filter(row) {
      console.log(this.minHeight);

      return row.minHeight &gt; 3;
    }
  }]);

  return ItemsComponent;
}();
</code></pre>