TemplateFactory | UI-Router
Options
All
  • Public
  • Public/Protected
  • All
Menu

Class TemplateFactory

Service which manages loading of templates from a ViewConfig.

Hierarchy

  • TemplateFactory

Index

Methods

  • Creates a template from a configuration object.

    Parameters

    • config: Ng1ViewDeclaration
      :

      Configuration object for which to load a template. The following properties are search in the specified order, and the first one that is defined is used to create the template:

    • params: any
      :

      Parameters to pass to the template function.

    • context: ResolveContext
      :

      The resolve context associated with the template's view

    Returns any

    :

    The template html as a string, or a promise for that string,or null if no template is configured.


  • fromProvider(provider: IInjectable, params: any, context: ResolveContext): Promise<any>
  • Creates a template by invoking an injectable provider function.

  • Creates a template by invoking an injectable provider function.

    Parameters

    Returns Promise<any>

    :

    The template html as a string, or a promise for that string.


  • fromString(template: string | Function, params?: any): any
  • Creates a template from a string or a function returning a string.

  • Creates a template from a string or a function returning a string.

    Parameters

    • template: string | Function
      :

      html template as a string or function that returns an html template as a string.

    • params Optional: any
      :

      Parameters to pass to the template function.

    Returns any

    :

    The template html as a string, or a promise for that string.


  • fromUrl(url: string | Function, params: any): string
  • Loads a template from the a URL via $http and $templateCache.

  • Loads a template from the a URL via $http and $templateCache.

    Parameters

    • url: string | Function
      :

      url of the template to load, or a function that returns a url.

    • params: any
      :

      Parameters to pass to the url function.

    Returns string

    :

    The template html as a string, or a promise for that string.


Generated using TypeDoc