From 84bb0ee2c742dc4c1129d1ce1c5e5de686170c81 Mon Sep 17 00:00:00 2001 From: Panu Horsmalahti Date: Tue, 18 Nov 2014 09:32:13 +0200 Subject: [PATCH] Fix the params type in angular-ui-router --- angular-ui/angular-ui-router-tests.ts | 10 +++++++--- angular-ui/angular-ui-router.d.ts | 6 +++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/angular-ui/angular-ui-router-tests.ts b/angular-ui/angular-ui-router-tests.ts index 971a47cd2..8b9027564 100644 --- a/angular-ui/angular-ui-router-tests.ts +++ b/angular-ui/angular-ui-router-tests.ts @@ -17,7 +17,7 @@ myApp.config(( var concat: ng.ui.IUrlMatcher = matcher.concat('/test'); var str: string = matcher.format({ id:'bob', q:'yes' }); var arr: string[] = matcher.parameters(); - + $urlRouterProvider .when('/test', '/list') .when('/test', '/list') @@ -34,7 +34,11 @@ myApp.config(( $stateProvider .state('state1', { url: "/state1", - templateUrl: "partials/state1.html" + templateUrl: "partials/state1.html", + params: { + param1: "defaultValue", + param2: undefined + } }) .state('state1.list', { url: "/list", @@ -135,7 +139,7 @@ myApp.service("urlLocatorTest", UrlLocatorTestService); module UiViewScrollProviderTests { var app = angular.module("uiViewScrollProviderTests", ["ui.router"]); - + app.config(['$uiViewScrollProvider', function($uiViewScrollProvider: ng.ui.IUiViewScrollProvider) { // This prevents unwanted scrolling to the active nested state view. // Use this when you have nested states, but you don't want the browser to scroll down the page diff --git a/angular-ui/angular-ui-router.d.ts b/angular-ui/angular-ui-router.d.ts index eb9296dbd..54f3c4de2 100644 --- a/angular-ui/angular-ui-router.d.ts +++ b/angular-ui/angular-ui-router.d.ts @@ -17,7 +17,7 @@ declare module ng.ui { controllerProvider?: any; resolve?: {}; url?: string; - params?: any[]; + params?: any; views?: {}; abstract?: boolean; onEnter?: any; @@ -108,10 +108,10 @@ declare module ng.ui { */ sync(): void; } - + interface IUiViewScrollProvider { /* - * Reverts back to using the core $anchorScroll service for scrolling + * Reverts back to using the core $anchorScroll service for scrolling * based on the url anchor. */ useAnchorScroll(): void;