import $APIRouteProvider from 'angie-rest-framework/src/factories/$APIRouteProvider.js'
$APIRouteProvider
You can directly use instance of this class.
$APIRouteProvider
Extends:
$RouteProvider → $APIRouteProvider
$APIRouteProvider is an abstraction on top of the default Angie
$RouteProvider. It is included as "$APIRoutes" and has the same functionality
as $Routes with the exception that it prevents the inclusion of the template
and templatePath
properties in the declaration of application routes. These
properties make no sense in the RESTful world.
TODO:
- use Symbols for RegExp store
Static Method Summary
Static Public Methods | ||
public static |
An alias of the $RouteProvider.when method |
since 0.0.1 |
Static Public Methods
public static when(str: string | Object, obj: Object): function since 0.0.1 source
An alias of the $RouteProvider.when method
Params:
Name | Type | Attribute | Description |
str | string | Object | String or RegExp to denote the endpoint path |
|
obj | Object | ||
obj.templatePath | string |
|
Optional template path |
obj.template | string |
|
Optional template html |
obj.Controller | string |
|
The name of the associated Controller |
obj.* | object |
|
A deep route with another route object to associate with a route consisting of the original path added to the new key |
Example:
$APIRoutes.when('/test', {
Controller: 'TestCtrl',
test2: {
Controller: 'Test2Ctrl'
}
});