diff --git a/angular-ui/angular-ui-router-tests.ts b/angular-ui/angular-ui-router-tests.ts index 8b90275644..c31bb16889 100644 --- a/angular-ui/angular-ui-router-tests.ts +++ b/angular-ui/angular-ui-router-tests.ts @@ -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' }); diff --git a/angular-ui/angular-ui-router.d.ts b/angular-ui/angular-ui-router.d.ts index 54f3c4de26..53761552f4 100644 --- a/angular-ui/angular-ui-router.d.ts +++ b/angular-ui/angular-ui-router.d.ts @@ -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 {