@@ -42,19 +42,19 @@ export class TemplateFactory implements TemplateFactoryProvider {
4242 * @return {string|object } The template html as a string, or a promise for
4343 * that string,or `null` if no template is configured.
4444 */
45- fromConfig ( config : Ng1ViewDeclaration , params : any , context : ResolveContext ) {
45+ fromConfig ( config : Ng1ViewDeclaration , params : any , context : ResolveContext ) : Promise < { template ?: string , component ?: string } > {
4646 const defaultTemplate = "<ui-view></ui-view>" ;
4747
48- const asTemplate = ( result ) => services . $q . when ( result ) . then ( str => ( { template : str } ) ) ;
48+ const asTemplate = ( result ) => services . $q . when ( result ) . then ( str => ( { template : str } ) ) ;
4949 const asComponent = ( result ) => services . $q . when ( result ) . then ( str => ( { component : str } ) ) ;
5050
5151 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 )
5858 ) ;
5959 } ;
6060
0 commit comments