1

In my case I want to link the user

 #/page/{{type}}/{{uservalue}}

The type is a radio button and uservalue is something the user wrote. How do I make this link not clickable until both values have been specified?

0

1 Answer 1

2

You can define link click handler in scope:

$scope.gotoUser = function (event, type, uservalue) {
  if (event) event.preventDefault();
  if (type && uservalue) {
    $location.path('/user/' + type + '/' + uservalue);
  } else {
    return false;
  }
}

And then in html:

<a ng-click="gotoUser($event, type, uservalue)"></a>

Maybe someone can guess better approach with preserving link href attribute.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.