Description

Provides tools for dynamically interacting with the head element.

Index

core/src/head/head.service.ts

Methods

Constructor

constructor(document: DocumentRef)
Parameters:
Name Type Optional
document DocumentRef No

Methods

Public addElement
addElement(name: string, config?: ElementConfigurator)
Type parameters:
  • TElement

Creates an element of the given name, configures it and adds it to the element.

configurator's properties. If a function was specified, the function is run on the element without any other intervention.

Parameters:
Name Type Optional Description
name string No

The name of the tag to create.

config ElementConfigurator<TElement> Yes

(Optional) The configurator for the element. If an object was specified, the element's properties will be overwritten by the configurator's properties. If a function was specified, the function is run on the element without any other intervention.

Returns: ElementRef<TElement>

A reference to the new element which has already been added to the element.

Public addLinkElement
addLinkElement(rel: LinkRel | LinkRel[], config?: LinkConfigurator)

Creates a element, configures it and adds it to the element.

configurator's properties. If a function was specified, the function is run on the element without any other intervention.

Parameters:
Name Type Optional Description
rel LinkRel | LinkRel[] No

The relationship(s) of the link with the current document.

config LinkConfigurator Yes

(Optional) The configurator for the element. If an object was specified, the element's properties will be overwritten by the configurator's properties. If a function was specified, the function is run on the element without any other intervention.

Returns: ElementRef<HTMLLinkElement>

A reference to the new element which has already been added to the element.

Public addScriptElement
addScriptElement(type: string, src: string, config?: ScriptConfigurator)

Creates a