Module provides generic routing configuration. It works in applications that most of the time use one controller for one page. In that situation it is normal to specify controller in html.
With configuration and link after clicking there will be server request for view Assuming that person.html contains it may use person's id
You may define your views by providing routeConfiguration
service.
Parameter | Description |
---|---|
routeConfiguration.rootPath |
Defines base url for view definition lookup |
routeConfiguration.extension |
Defines view url extension. It will be concatenated to every view url searched. |
There are 4 default routing strategies matched in order as described below. Each basic view has to be placed in
directory. It cannot be subdirectory, or base directory. It enforces splitting views in directories. Standard
link looks like this: <a href="/#/organization/person/">
. Here we have
organization
directory in which person
view file will be looked up.
$routeParams.idEntity
parameter will contain value of .
Part | Role |
---|---|
:dir |
Directory in views rootPath in which view is placed |
:idView |
Name of the view. It will be concatenated with extension before sending request |
:idEntity |
Value that will be accessible to controller by $routeParams.idEntity |
:parent |
Parent entity name. |
:idParentEntity |
Value that will be accessible to controller by $routeParams.idParentEntity |
/:dir/:parent/:idParentEntity/:idView/:idEntity
/:dir/:parent/:idParentEntity/:idView
/:dir/:idView/:idEntity
/:dir/:idView
Module provides interceptor for handling error status codes:
Code | Type | Action |
---|---|---|
401 | unauthorized | $rootScope.loggedIn property is set to false when unauthorized status is
returned |
403 | forbidden | is logged if possible |
500 | internal server error | shows information in toastr panel |