-
Notifications
You must be signed in to change notification settings - Fork 102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consider using ui-router for application state #51
Labels
Comments
@jniles what is the label for this issue? |
Not sure. Proposal? Design? Discussion? Something like that. |
@IMA-WorldHealth/local-contributors I will investigate what it would mean to transition to UI-router today and report back in this thread. |
Merged
This was referenced Mar 23, 2016
jniles
referenced
this issue
in jniles/bhima
Jan 6, 2017
This commit removes the text "ID" from the receipts. Closes #51.
jniles
referenced
this issue
in jniles/bhima
Jan 7, 2017
This commit removes the text "ID" from the receipts. Closes #51.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The application has never handled state well. For simple cases (do we have a primary cashbox or not?), the controller has often just used an
ng-if
directly in the HTML to show/hide components. For more complex cases, the controller uses anng-switch
(create/update/success/failure). Admin modules are good examples of these. In the most complex cases, sometimes anng-switch
is coupled with anng-include
and even a new controller is templated in. Receipts is a good example of this condition.One solution is to use the router to manage state. Our current router (
ngRouter
) is limited to only directly mapping URLs to individual templates and controllers, 1-1-1. A different project,ui-router
allows you to nest controllers and views, so that child states can inherit properties of the parent states, and you can have multiple views on a single page (we currently only have on ng-view).Advantages of ui-router:
/patients
<-/patients/:id
<-/patients/:id/groups
) to reduce the need for services and extra $http requests.Dis-advantages of ui-router:
link.
The text was updated successfully, but these errors were encountered: