• Randall Leeds's avatar
    Use $route.reload() instead of refresh events · 4c462bdf
    Randall Leeds authored
    Rather than using extra events to trigger a round trip through the
    visual search directive callbacks and query parsing, simply rely on
    $location.search() at the time the route controller is instantiated
    and stop using `reloadOnSearch: false` in the route definitions so
    that changes to the search trigger a refresh of the view.
    
    The QueryParser now splits `populateFilter` into `parseModels` and
    `populateFilter` so that the models can be parsed when the visual
    search callback fires and the filter can be populated separately
    from the query string after the route reload.
    
    Summary of improvements:
    
    - Drop the VSSearch and RefreshSearch events.
    - Make the search.query scope property a simple value instead of a
      function. This reduces the work required for the watcher and is
      possible because we no longer update the query string unless the
      query changes and the route will reload if it does.
    - Clearing the stream is no longer necessary, since it starts clear
      on each route reload.
    4c462bdf
streamsearch.coffee 1.95 KB