Fix the params type in angular-ui-router

This commit is contained in:
Panu Horsmalahti
2014-11-18 09:32:13 +02:00
parent 97a4f36d64
commit 84bb0ee2c7
2 changed files with 10 additions and 6 deletions

View File

@@ -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

View File

@@ -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;