Service which manages loading of templates from a ViewConfig.

Constructors

Properties

$get: (string | (($http: any, $templateCache: any, $templateRequest: any, $q: any, $injector: InjectorService) => TemplateFactory))[] = ...
$http: any
$injector: InjectorService
$q: any
$templateCache: any
$templateRequest: any
_useHttp: boolean

Methods

  • Creates a component's template by invoking an injectable provider function.

    Parameters

    • provider: Injectable<T>

      Function to invoke via locals

    • params: Function

      a function used to invoke the template provider

    • context: any

    Returns string

    The template html as a string: "".

  • Creates a template from a configuration object.

    Parameters

    • config: any

      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.

  • Creates a template by invoking an injectable provider function.

    Parameters

    • provider: Injectable<T>

      Function to invoke via locals

    • params: Function

      a function used to invoke the template provider

    • context: ResolveContext

    Returns string | Promise<string>

    The template html as a string, or a promise for that 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.

    • Optionalparams: any

      Parameters to pass to the template function.

    Returns any

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

  • 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 | Promise<string>

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

  • Creates a template from a component's name

    This implements route-to-component. It works by retrieving the component (directive) metadata from the injector. It analyses the component's bindings, then constructs a template that instantiates the component. The template wires input and output bindings to resolves or from the parent component.

    Parameters

    • ngView: any

      {object} The parent ui-view (for binding outputs to callbacks)

    • context: ResolveContext

      The ResolveContext (for binding outputs to callbacks returned from resolves)

    • component: string

      {string} Component's name in camel case.

    • Optionalbindings: any

      An object defining the component's bindings: {foo: '<'}

    Returns string

    The template as a string: "".

  • Forces the provider to use $http service directly

    Parameters

    • value: boolean

    Returns void