Right ok. Hmmm. I think it would be more convenient as null in use. It
doesn't seem fatal enough to throw an error in my opinion. I wonder what
@ksperling thinks.

Thanks,
Tim

(Sent from my mobile)

On Jun 19, 2013, at 9:37 PM, Nate Abele <notifications@github.com> wrote:

In src/stateDirectives.js:

> +$StateRefDirective.$inject = ['$state'];
> +function $StateRefDirective($state) {
> +  return {
> +    restrict: 'A',
> +    link: function(scope, element, attrs) {
> +      var ref = parseStateRef(attrs.uiSref);
> +      var params = null, url = null;
> +      var isForm = element[0].nodeName === "FORM";
> +      var attr = isForm ? "action" : "href", nav = true;
> +
> +      var update = function(newVal) {
> +        if (newVal) params = newVal;
> +        if (!nav) return;
> +
> +        try {
> +          element[0][attr] = $state.href(ref.state, params, { lossy: true });

On the other hand, I was just looking at the href() code, and replacing the
exception with null means losing debugging information for the developer.
Do you want to go ahead with it anyway? I think if there is an accessor for
state objects, there will be much easier ways to check this (i.e.
doing state.url
|| state.navigable.url).

—
Reply to this email directly or view it on
GitHub<https://github.com/angular-ui/ui-router/pull/139/files#r4788291>
.