-
Notifications
You must be signed in to change notification settings - Fork 3k
Votes on Router Specs old
btpka3 edited this page Apr 14, 2015
·
1 revision
- Add a + on a feature or design point you concur
- Add a - on a feature or design point you do not like
- Create a new bullet for new feature/design points
- Nest bullets if they are related or subfeatures/points
- Keep bullets concise
- Vote count will decide priority
- You can vote on any bullet once
- Avoid 'discussing' bullets here. If you disagree, down-vote and discuss in #1
- API should be backwards-compatible with current router (+0 / -0)
- Defining routes
- Should be a recursively nested object (+5 / -2)
- Can append more children later in separate method call:
andWhen('/parent/route', '/child')
(+1 / -3) - Can define an 'otherwise' clause for nested routes (identical to
otherwise()
) (+2 / -0) - Routes can specify subroutes AND multiple views. Views are the "leafs" in the tree. (+2 / 0)
- Routes should have an identifier other than their URL pattern (+1 / 0)
- Parameters
- Should support an optional syntax:
/user/:id[/:searchTerm]
(+3 / -4) - Should support typecasting syntax:
/user/int:id
(+3 / -3) - Parameter parsing should be handled by a separate service: (+1 / 0)
- Route / View Names
- Should be optional
- Single view (+4 / -0)
- If nested view, unnamed route uses unnamed view at the same nesting level (+2 / -1)
- Names circumvent nesting level (+2 / -1)
- Loading Controllers
- All descendant controllers are reloaded (+3 / -1)
-
$routeUpdated
event is$broadcast
instead of reloading controller- Always use event (+0 / -2)
- Provide optional to opt-in, otherwise reload controller (+3 / -0)
- Provide option to opt-in recursively (instead of this controller only) (+0 / -1)
- If child route no longer matches
- controller is unloaded (+1 / -1)
- option to disable unloading (+3 / -0)
- related view is emptied (+2 / -1)
- option to disable unloading (+2 / -1)
- Descendant controllers should have access to scope content of ancestors (+4 / -1)
- Routes can specify a single controller for each view (named views). (+1 / 0)
- Additionally a model can be passed to set the content of the controller (+1 / 0)
- Utilities
- Publicly providers a route checking (+1 / -0)
1. Simplistic REGEX function:
uiRouter.is('/some/*')
(+1 / -0) 2. Developers can place onto scope:$rootScope.isRoute = uiRouter.is
(+0 / -0) 3. Directive to toggle an active class (+1 / -0)