mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-16 19:09:18 +08:00
Add the type function to angular ui-router url matcher factory
This commit is contained in:
@@ -13,6 +13,13 @@ myApp.config((
|
||||
$urlMatcherFactory: ng.ui.IUrlMatcherFactory) => {
|
||||
|
||||
var matcher: ng.ui.IUrlMatcher = $urlMatcherFactory.compile("/foo/:bar?param1");
|
||||
|
||||
$urlMatcherFactory.type("myType2", {
|
||||
encode: function (item: any) { return item; },
|
||||
decode: function (item: any) { return item; },
|
||||
is: function (item: any) { return true; }
|
||||
});
|
||||
|
||||
var obj: Object = matcher.exec('/user/bob', { x:'1', q:'hello' });
|
||||
var concat: ng.ui.IUrlMatcher = matcher.concat('/test');
|
||||
var str: string = matcher.format({ id:'bob', q:'yes' });
|
||||
|
||||
1
angular-ui/angular-ui-router.d.ts
vendored
1
angular-ui/angular-ui-router.d.ts
vendored
@@ -42,6 +42,7 @@ declare module ng.ui {
|
||||
interface IUrlMatcherFactory {
|
||||
compile(pattern: string): IUrlMatcher;
|
||||
isMatcher(o: any): boolean;
|
||||
type(name: string, definition: any, definitionFn?: any): any;
|
||||
}
|
||||
|
||||
interface IUrlRouterProvider extends IServiceProvider {
|
||||
|
||||
Reference in New Issue
Block a user