@@ -42,19 +42,19 @@ export class TemplateFactory implements TemplateFactoryProvider {
42
42
* @return {string|object } The template html as a string, or a promise for
43
43
* that string,or `null` if no template is configured.
44
44
*/
45
- fromConfig ( config : Ng1ViewDeclaration , params : any , context : ResolveContext ) {
45
+ fromConfig ( config : Ng1ViewDeclaration , params : any , context : ResolveContext ) : Promise < { template ?: string , component ?: string } > {
46
46
const defaultTemplate = "<ui-view></ui-view>" ;
47
47
48
- const asTemplate = ( result ) => services . $q . when ( result ) . then ( str => ( { template : str } ) ) ;
48
+ const asTemplate = ( result ) => services . $q . when ( result ) . then ( str => ( { template : str } ) ) ;
49
49
const asComponent = ( result ) => services . $q . when ( result ) . then ( str => ( { component : str } ) ) ;
50
50
51
51
return (
52
- isDefined ( config . template ) ? asTemplate ( this . fromString ( config . template , params ) ) :
53
- isDefined ( config . templateUrl ) ? asTemplate ( this . fromUrl ( config . templateUrl , params ) ) :
54
- isDefined ( config . templateProvider ) ? asTemplate ( this . fromProvider ( config . templateProvider , params , context ) ) :
55
- isDefined ( config . component ) ? asComponent ( config . component ) :
56
- isDefined ( config . componentProvider ) ? asComponent ( this . fromComponentProvider ( config . componentProvider , params , context ) ) :
57
- asTemplate ( defaultTemplate )
52
+ isDefined ( config . template ) ? asTemplate ( this . fromString ( config . template , params ) ) :
53
+ isDefined ( config . templateUrl ) ? asTemplate ( this . fromUrl ( config . templateUrl , params ) ) :
54
+ isDefined ( config . templateProvider ) ? asTemplate ( this . fromProvider ( config . templateProvider , params , context ) ) :
55
+ isDefined ( config . component ) ? asComponent ( config . component ) :
56
+ isDefined ( config . componentProvider ) ? asComponent ( this . fromComponentProvider ( config . componentProvider , params , context ) ) :
57
+ asTemplate ( defaultTemplate )
58
58
) ;
59
59
} ;
60
60
0 commit comments