Skip to content

ui router & changing the view state

R. Alex Clark edited this page Oct 9, 2015 · 2 revisions

Ui-Router

What does it do?

Takes care of switching between views for us and handles passing some of the id's and parameters between pages.

What are the states we have setup in the application?

Currently:

  • Sign In - 'sign-in'
  • Study Home - 'home'
  • Study Info - 'study-info'
  • Group Info - 'study-group'
  • Enrollment Page - 'enrollment'
  • Subject Info - 'subject-info'

How do I change the url of the application?

Since the states of each webpage are already setup, simply include the attribute 'ui-sref=' in the tag for the button to take you to the desired page. This can also be done using the regular tags by setting the href to the stateName.

Further Documentation

[Angular Ui-Router Quick Reference] (https://github.com/angular-ui/ui-router/wiki/Quick-Reference#ui-view)