@@ -16,9 +16,7 @@ import {map, bindFunctions, removeFrom, find, noop} from "../common/common";
16
16
import { prop , propEq } from "../common/hof" ;
17
17
import { isObject } from "../common/predicates" ;
18
18
import { Node } from "../path/node" ;
19
- import { Resolvable } from "../resolve/resolvable" ;
20
- import { ResolveContext } from "../resolve/resolveContext" ;
21
- import { State } from "../state/stateObject" ;
19
+ import { resolveFactory } from "./legacy/resolveService" ;
22
20
import { trace } from "../common/trace" ;
23
21
import { ng1ViewsBuilder , ng1ViewConfigFactory , Ng1ViewConfig } from "./statebuilders/views" ;
24
22
import { TemplateFactory } from "./templateFactory" ;
@@ -215,31 +213,6 @@ function ng1UIRouter($locationProvider) {
215
213
}
216
214
}
217
215
218
- const resolveFactory = ( ) => ( {
219
- /**
220
- * This emulates most of the behavior of the ui-router 0.2.x $resolve.resolve() service API.
221
- * @param invocables an object, with keys as resolve names and values as injectable functions
222
- * @param locals key/value pre-resolved data (locals)
223
- * @param parent a promise for a "parent resolve"
224
- */
225
- resolve : ( invocables , locals = { } , parent ?) => {
226
- let parentNode = new Node ( new State ( < any > { params : { } } ) ) ;
227
- let node = new Node ( new State ( < any > { params : { } } ) ) ;
228
- let context = new ResolveContext ( [ parentNode , node ] ) ;
229
-
230
- context . addResolvables ( Resolvable . makeResolvables ( invocables ) , node . state ) ;
231
-
232
- const resolveData = ( parentLocals ) => {
233
- const rewrap = _locals => Resolvable . makeResolvables ( < any > map ( _locals , local => ( ) => local ) ) ;
234
- context . addResolvables ( rewrap ( parentLocals ) , parentNode . state ) ;
235
- context . addResolvables ( rewrap ( locals ) , node . state ) ;
236
- return context . resolvePath ( ) ;
237
- } ;
238
-
239
- return parent ? parent . then ( resolveData ) : resolveData ( { } ) ;
240
- }
241
- } ) ;
242
-
243
216
function $stateParamsFactory ( ng1UIRouter ) {
244
217
return ng1UIRouter . globals . params ;
245
218
}
0 commit comments