$templateFactory
(service in module ui.router.util
)
Service. Manages loading of templates.
Creates a template from a configuration object.
config – {object} –
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:
config.template – {string|object} –
html string template or function to load via fromString.
config.templateUrl – {string|object} –
url to load or a function returning the url to load via fromUrl.
config.templateProvider – {Function} –
function to invoke via fromProvider.
params – {object} –
Parameters to pass to the template function.
locals – {object} –
Locals to pass to invoke
if the template is loaded
via a templateProvider
. Defaults to { params: params }
.
{string|object}
– The template html as a string, or a promise for
that string,or null
if no template is configured.
Creates a template from a string or a function returning a string.
template – {string|object} –
html template as a string or function that returns an html template as a string.
params – {object} –
Parameters to pass to the template function.
{string|object}
– The template html as a string, or a promise for that string.
Loads a template from the a URL via $http
and $templateCache
.
url – {string|Function} –
url of the template to load, or a function that returns a url.
params – {Object} –
Parameters to pass to the url function.
{string|Promise.<string>}
– The template html as a string, or a promise for that string.
Creates a template by invoking an injectable provider function.
provider – {Function} –
Function to invoke via $injector.invoke
params – {Object} –
Parameters for the template.
locals – {Object} –
Locals to pass to invoke
. Defaults to
{ params: params }
.
{string|Promise.<string>}
– The template html as a string, or a promise for that string.