mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-07 08:17:05 +00:00
Add $stickyState.reset() to ui-router-extras typings
http://christopherthielen.github.io/ui-router-extras/#/sticky
This commit is contained in:
Vendored
+6
@@ -131,6 +131,12 @@ declare module 'angular' {
|
||||
*/
|
||||
interface IStickyStateService {
|
||||
getInactiveStates(): IStickyState[];
|
||||
/*
|
||||
* If there is an inactive state named inactiveStateName, this method exits that state.
|
||||
* If stateParams is provided, then the state is only exited if the params match the inactive params.
|
||||
* If inactiveStateName === '*', then all inactive states are exited
|
||||
*/
|
||||
reset(inactiveStateName: string, stateParams?: { [key: string]: string | string[] }): void;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -16,7 +16,7 @@ myApp.config(($stateProvider: angular.ui.IStateProvider, $stickyStateProvider: a
|
||||
onReactivate: ($state: angular.ui.IState) => {
|
||||
const iAmInjectedByInjector = $state;
|
||||
},
|
||||
controller: ($previousState: angular.ui.IPreviousStateService, $deepstateRedirect: angular.ui.IDeepStateRedirectService) => {
|
||||
controller: ($previousState: angular.ui.IPreviousStateService, $deepstateRedirect: angular.ui.IDeepStateRedirectService, $stickyState: angular.ui.IStickyStateService) => {
|
||||
$previousState.memo('test-memo1');
|
||||
$previousState.memo('test-memo2', 'test-state-name2');
|
||||
$previousState.memo('test-memo3', 'test-state-name3', {});
|
||||
@@ -32,6 +32,13 @@ myApp.config(($stateProvider: angular.ui.IStateProvider, $stickyStateProvider: a
|
||||
stateParam1: ['value1', 'value2'],
|
||||
stateParam2: 'value'
|
||||
});
|
||||
|
||||
$stickyState.getInactiveStates();
|
||||
$stickyState.reset('state1');
|
||||
$stickyState.reset('state2', {
|
||||
stateParam1: ['value1', 'value2'],
|
||||
stateParam2: 'value'
|
||||
});
|
||||
},
|
||||
views: {
|
||||
// named views are mandatory
|
||||
|
||||
Reference in New Issue
Block a user