-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(resolve): Fix regression; Allow resolve values to be service names
closes #2588
- Loading branch information
1 parent
adfbde3
commit a34fd3b
Showing
4 changed files
with
31 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/** @module ng1 */ /** */ | ||
import {State} from "../state/stateObject"; | ||
import {forEach} from "../common/common"; | ||
import {isString} from "../common/predicates"; | ||
|
||
/** | ||
* This is a [[StateBuilder.builder]] function for angular1 `resolve:` block on a [[Ng1StateDeclaration]]. | ||
* | ||
* When the [[StateBuilder]] builds a [[State]] object from a raw [[StateDeclaration]], this builder | ||
* handles the `resolve` property with logic specific to angular-ui-router (ng1). | ||
*/ | ||
export function ng1ResolveBuilder(state: State) { | ||
let resolve = {}; | ||
forEach(state.resolve || {}, function (resolveFn, name: string) { | ||
resolve[name] = isString(resolveFn) ? [ resolveFn, x => x ] : resolveFn; | ||
}); | ||
return resolve; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters