[ Angular ] ui-router


binds a link ( tag) to a state, click anchor to change a state

ref : https://github.com/angular-ui/ui-router/wiki/Quick-Reference#ui-sref


passing variable


add classes to an element when the related ui-sref directive’s state is active, and removing them when it is inactive.

ui-sref-active='class1 class2 class3'

Example : add “active” class if “app.user” state is active in *any* child.

	<li ui-sref-active="active" class="item">
<a href ui-sref="app.user({user: 'bilbobaggins'})">@bilbobaggins</a></li>

ref : https://github.com/angular-ui/ui-router/wiki/Quick-Reference#ui-sref-active,



Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s