title: How to conditionally add attributes to an element using Angular? (Not only attribute data, the whole attribute)
body: <p>I have some links created with angular material. In there for links and buttons we us <code>&lt;md-button&gt;</code>. Now I have a link and I need to add the href attribute to it only if the url is present. Otherwise it should not have a href.</p>
  
  <p>The reason is, I have main links and sub-links underneath. Main links which have sub-links can't have an href. If it does have at least and empty href, as soon as I click it to expand the sub-links, it will take me to the index template. There are main links which don't have any sub-links. So, for them I need the href and for the links with sub-links I need to completely remove the href. How can I do this?</p>