src/services/url-manager.js
function() {
    var current = $state.current();

    if(current && current.url) {
      var path;
      path = current.url;

      // Add parameters or use default parameters
      var params = current.params || {};
      var query = {};
      for(var name in params) {
        var re = new RegExp(':'+name, 'g');
        if(path.match(re)) {
          path = path.replace(re, params[name]);
        } else {
          query[name] = params[name];
        }
      }

      $location.path(path);
      $location.search(query);
      
      _url = $location.url();
    }
  }
function() {
    var current = $state.current();

    if(current && current.url) {
      var path;
      path = current.url;

      // Add parameters or use default parameters
      var params = current.params || {};
      var query = {};
      for(var name in params) {
        var re = new RegExp(':'+name, 'g');
        if(path.match(re)) {
          path = path.replace(re, params[name]);
        } else {
          query[name] = params[name];
        }
      }

      $location.path(path);
      $location.search(query);
      
      _url = $location.url();
    }
  }
function ( ) { var current = $state . current ( ) ; if ( current && current . url ) { var path ; path = current . url ; // Add parameters or use default parameters var params = current . params || { } ; var query = { } ; for ( var name in params ) { var re = new RegExp ( ':' + name , 'g' ) ; if ( path . match ( re ) ) { path = path . replace ( re , params [ name ] ) ; } else { query [ name ] = params [ name ] ; } } $location . path ( path ) ; $location . search ( query ) ; _url = $location . url ( ) ; } }
Update URL based on state
Update URL based on state