code: function update(evt) {
                  if (evt && evt.defaultPrevented) return;
  
                  function check(rule) {
                      var handled = rule($injector, $location);
  
                      if (!handled) return false;
                      if (isString(handled)) $location.replace().url(handled);
                      return true;
                  }
                  var n = rules.length, i;
  
                  for (i = 0; i < n; i++) {
                      if (check(rules[i])) return;
                  }
                  // always check otherwise last to allow dynamic updates to the set of rules
                  if (otherwise) check(otherwise);
              }
docs: TODO: Optimize groups of rules with non-empty prefix into some sort of decision tree