client/assets/scripts/services/search.js
function (params) {
        var self = this;
        this.parseParams(params);
        if (!this.loaded) {
          this.fetchApi(api).success(function (data) {
            packages = data;
            self.loaded = true;
            self.search();
          });
        }
        else {
          this.search();
        }
      }
function (params) {
        var self = this;
        this.parseParams(params);
        if (!this.loaded) {
          this.fetchApi(api).success(function (data) {
            packages = data;
            self.loaded = true;
            self.search();
          });
        }
        else {
          this.search();
        }
      }
function ( params ) { var self = this ; this . parseParams ( params ) ; if ( ! this . loaded ) { this . fetchApi ( api ) . success ( function ( data ) { packages = data ; self . loaded = true ; self . search ( ) ; } ) ; } else { this . search ( ) ; } }
Set params and update results
Set params and update results