Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ui-sref and md-button. How it works?

Example

Why menu item "Menu1" above the others if i add ui-sref ????

 <md-button  ui-sref="menu1" >Menu1</md-button>
 <md-button>Menu2</md-button>
like image 901
Slip Avatar asked Sep 07 '15 09:09

Slip


3 Answers

It's actually better to wrap the button in the a tag. The problem with the recommended solution is that only the text acts as a link rather than the whole button, so I'd suggest;

<a ui-sref="menu1"><md-button>Menu1</md-button></a>
like image 67
Stuart Hallows Avatar answered Oct 30 '22 05:10

Stuart Hallows


If you are using ui-sref, then you should enclose it with Anchor tag.

<md-button><a ui-sref="menu1">Menu1</a></md-button>

As Hooligancat says, here is the updated Code:

<a ui-sref="menu1" class="md-button">Menu1</a>

Hope it works

like image 5
Thinker Avatar answered Oct 30 '22 05:10

Thinker


Better yet is to dispense with using two tags and specify 'md-button' as a class on the 'a' tag.

<a ui-sref="menu1" class="md-button">Menu1</a>

You can of course add any other material class tags too...

<a ui-sref="menu1" class="md-button md-raised md-primary">Menu1</a>
like image 3
Hooligancat Avatar answered Oct 30 '22 06:10

Hooligancat