title: How can I conditionally use either [href] or [routerLink] on an anchor?
body: <p>I need for the same anchor link to be pointed conditionally locally or to external resource. I tried </p>
  
  
  
  <pre class="lang-html prettyprint-override"><code>&lt;a [href]="outside?externalUrl:null"  [routerLink]="outside?[]:['/route',id]" &gt;test&lt;/a&gt;
  </code></pre>
  
  <p>But it doesn't work. I don't get any errors, but it points to the same local page and ignores the external URL. Any ideas?</p>
  
  <p>Another option would be to construct the link, but I can't find any docs how to access <code>routerLink</code> inside a service</p>
  
  <p>Edit: I know I can clone the whole link with <code>*ngIf</code> but I don't want to do it, my link contains a video tag with a buch of options</p>