Набор роутов - one-to-one map существующих контроллеров некоторому паттерну URL Вместе контроллера может использоваться элементная директива или компонента Роутер следит на изменениями $location.url и в соответсвии с изменениями отдаёт нужный роут 8
way to refer to the state views - How the UI will look and behave url -What the browser’s URL will be params -Parameter values that the state requires (such as blog-post-id) resolve -The actual data the state requires (often fetched, asynchronously, from the backend using a parameter value)
a state: 1. Call $state.go(). High-level convenience method. 2. Click a link containing the ui-sref directive. 3. Navigate to the url associated with the state. 16
path is exactly '/hello/'. There is no special treatment for trailing slashes, and patterns have to match the entire path, not just a prefix. • '/user/:id' - Matches '/user/bob' or '/user/1234!!!' or even '/user/' but not '/ user' or '/user/bob/details'. The second path segment will be captured as the parameter 'id'. • '/user/{id}' - Same as the previous example, but using curly brace syntax. • '/user/{id:int}' - The param is interpreted as Integer. • ‘/user/{id:[^/]*}’ - regExp • ‘^/list’ - absolute route
state urls. • To insert a template with its own ui-view(s) that its child states will populate. • Optionally assign a controller to the template. The controller must pair to a template. • Additionally, inherit $scope objects down to children, just understand that this happens via the view hierarchy, not the state hierarchy. • To provide resolved dependencies via resolve for use by child states. • To provide inherited custom data via data for use by child states or an event listener. • To run an onEnter or onExit function that may modify the application in someway. • Any combination of the above. 25