Internal
Creates a new instance.
Subscribes to the ContentObserver
to listen for new <style>
elements
added to the document head. If a new <style>
element is added, the
#updateRegistry()
method is called.
The Angular ContentObserver service
A service to register new themes
A reference to the current document
Private
Readonly
documentA reference to the current document
Private
Readonly
observerThe Angular ContentObserver service
Private
Readonly
themeA service to register new themes
Private
#getPrivate
#updatePrivate
Updates the internal theme registry.
Identifies all <style>
elements without the data-no-theme
and data-theme
attributes.
Extracts the theme annotations from the elements' text content and applies the
data-theme
or data-no-theme
attribute depending on the discovered theme id.
A service that manages the activation and deactivation of themes.
The service uses the
ContentObserver
service to observe changes in the<head>
element and updates the internal theme registry when new<style>
elements are added to the DOM.Themes are identified by the
data-theme
attribute on the<style>
element.The service provides a method
use
to activate a theme with a given ID and deactivate all other themes.