Dart API Reference
dart:html
TemplateElement
TemplateElement
class
Annotated by:
Experimental()
DomName('HTMLTemplateElement')
SupportedBrowser(SupportedBrowser.CHROME)
Experimental()
Extends:
HtmlElement
Element
Node
EventTarget
Object
Constructors
TemplateElement
( )
TemplateElement.created
( )
Constructor instantiated by the DOM when a custom element has been created.
Static Properties
supported
bool
read-only
Instance Properties
content
DocumentFragment
read-only
on
ElementEvents
Inherited
read-only
nodes
List
<
Node
>
Inherited
read/write
baseUri
String
Inherited
read-only
childNodes
List
<
Node
>
Inherited
read-only
firstChild
Node
Inherited
read-only
lastChild
Node
Inherited
read-only
nextNode
Node
Inherited
read-only
nodeName
String
Inherited
read-only
nodeType
int
Inherited
read-only
nodeValue
String
Inherited
read-only
ownerDocument
Document
Inherited
read-only
parent
Element
Inherited
read-only
parentNode
Node
Inherited
read-only
previousNode
Node
Inherited
read-only
text
String
Inherited
read/write
contentEditable
String
Inherited
read/write
contextMenu
MenuElement
Inherited
read/write
dir
String
Inherited
read/write
draggable
bool
Inherited
read/write
hidden
bool
Inherited
read/write
lang
String
Inherited
read/write
spellcheck
bool
Inherited
read/write
tabIndex
int
Inherited
read/write
title
String
Inherited
read/write
translate
bool
Inherited
read/write
dropzone
String
Inherited
read/write
attributes
Map
<
String
,
String
>
Inherited
read/write
children
List
<
Element
>
Inherited
read/write
classes
CssClassSet
Inherited
read/write
dataset
Map
<
String
,
String
>
Inherited
read/write
client
Rectangle
Inherited
read-only
offset
Rectangle
Inherited
read-only
xtag
dynamic
Inherited
read/write
localName
String
Inherited
read-only
namespaceUri
String
Inherited
read-only
contentEdge
CssRect
Inherited
read-only
paddingEdge
CssRect
Inherited
read-only
borderEdge
CssRect
Inherited
read-only
marginEdge
CssRect
Inherited
read-only
documentOffset
Point
Inherited
read-only
innerHtml
String
Inherited
read/write
offsetHeight
int
Inherited
read-only
offsetLeft
int
Inherited
read-only
offsetTop
int
Inherited
read-only
offsetWidth
int
Inherited
read-only
clientHeight
int
Inherited
read-only
clientLeft
int
Inherited
read-only
clientTop
int
Inherited
read-only
clientWidth
int
Inherited
read-only
scrollHeight
int
Inherited
read-only
scrollLeft
int
Inherited
read/write
scrollTop
int
Inherited
read/write
scrollWidth
int
Inherited
read-only
className
String
Inherited
read/write
id
String
Inherited
read/write
offsetParent
Element
Inherited
read-only
outerHtml
String
Inherited
read-only
shadowRoot
ShadowRoot
Inherited
read-only
style
CssStyleDeclaration
Inherited
read-only
tagName
String
Inherited
read-only
nextElementSibling
Element
Inherited
read-only
previousElementSibling
Element
Inherited
read-only
onAbort
ElementStream
<
Event
>
Inherited
read-only
onBeforeCopy
ElementStream
<
Event
>
Inherited
read-only
onBeforeCut
ElementStream
<
Event
>
Inherited
read-only
onBeforePaste
ElementStream
<
Event
>
Inherited
read-only
onBlur
ElementStream
<
Event
>
Inherited
read-only
onCanPlay
ElementStream
<
Event
>
Inherited
read-only
onCanPlayThrough
ElementStream
<
Event
>
Inherited
read-only
onChange
ElementStream
<
Event
>
Inherited
read-only
onClick
ElementStream
<
MouseEvent
>
Inherited
read-only
onContextMenu
ElementStream
<
MouseEvent
>
Inherited
read-only
onCopy
ElementStream
<
Event
>
Inherited
read-only
onCut
ElementStream
<
Event
>
Inherited
read-only
onDoubleClick
ElementStream
<
Event
>
Inherited
read-only
onDrag
ElementStream
<
MouseEvent
>
Inherited
read-only
onDragEnd
ElementStream
<
MouseEvent
>
Inherited
read-only
onDragEnter
ElementStream
<
MouseEvent
>
Inherited
read-only
onDragLeave
ElementStream
<
MouseEvent
>
Inherited
read-only
onDragOver
ElementStream
<
MouseEvent
>
Inherited
read-only
onDragStart
ElementStream
<
MouseEvent
>
Inherited
read-only
onDrop
ElementStream
<
MouseEvent
>
Inherited
read-only
onDurationChange
ElementStream
<
Event
>
Inherited
read-only
onEmptied
ElementStream
<
Event
>
Inherited
read-only
onEnded
ElementStream
<
Event
>
Inherited
read-only
onError
ElementStream
<
Event
>
Inherited
read-only
onFocus
ElementStream
<
Event
>
Inherited
read-only
onInput
ElementStream
<
Event
>
Inherited
read-only
onInvalid
ElementStream
<
Event
>
Inherited
read-only
onKeyDown
ElementStream
<
KeyboardEvent
>
Inherited
read-only
onKeyPress
ElementStream
<
KeyboardEvent
>
Inherited
read-only
onKeyUp
ElementStream
<
KeyboardEvent
>
Inherited
read-only
onLoad
ElementStream
<
Event
>
Inherited
read-only
onLoadedData
ElementStream
<
Event
>
Inherited
read-only
onLoadedMetadata
ElementStream
<
Event
>
Inherited
read-only
onMouseDown
ElementStream
<
MouseEvent
>
Inherited
read-only
onMouseEnter
ElementStream
<
MouseEvent
>
Inherited
read-only
onMouseLeave
ElementStream
<
MouseEvent
>
Inherited
read-only
onMouseMove
ElementStream
<
MouseEvent
>
Inherited
read-only
onMouseOut
ElementStream
<
MouseEvent
>
Inherited
read-only
onMouseOver
ElementStream
<
MouseEvent
>
Inherited
read-only
onMouseUp
ElementStream
<
MouseEvent
>
Inherited
read-only
onMouseWheel
ElementStream
<
WheelEvent
>
Inherited
read-only
onPaste
ElementStream
<
Event
>
Inherited
read-only
onPause
ElementStream
<
Event
>
Inherited
read-only
onPlay
ElementStream
<
Event
>
Inherited
read-only
onPlaying
ElementStream
<
Event
>
Inherited
read-only
onRateChange
ElementStream
<
Event
>
Inherited
read-only
onReset
ElementStream
<
Event
>
Inherited
read-only
onResize
ElementStream
<
Event
>
Inherited
read-only
onScroll
ElementStream
<
Event
>
Inherited
read-only
onSearch
ElementStream
<
Event
>
Inherited
read-only
onSeeked
ElementStream
<
Event
>
Inherited
read-only
onSeeking
ElementStream
<
Event
>
Inherited
read-only
onSelect
ElementStream
<
Event
>
Inherited
read-only
onSelectStart
ElementStream
<
Event
>
Inherited
read-only
onStalled
ElementStream
<
Event
>
Inherited
read-only
onSubmit
ElementStream
<
Event
>
Inherited
read-only
onSuspend
ElementStream
<
Event
>
Inherited
read-only
onTimeUpdate
ElementStream
<
Event
>
Inherited
read-only
onTouchCancel
ElementStream
<
TouchEvent
>
Inherited
read-only
onTouchEnd
ElementStream
<
TouchEvent
>
Inherited
read-only
onTouchEnter
ElementStream
<
TouchEvent
>
Inherited
read-only
onTouchLeave
ElementStream
<
TouchEvent
>
Inherited
read-only
onTouchMove
ElementStream
<
TouchEvent
>
Inherited
read-only
onTouchStart
ElementStream
<
TouchEvent
>
Inherited
read-only
onTransitionEnd
ElementStream
<
TransitionEvent
>
Inherited
read-only
onVolumeChange
ElementStream
<
Event
>
Inherited
read-only
onWaiting
ElementStream
<
Event
>
Inherited
read-only
onFullscreenChange
ElementStream
<
Event
>
Inherited
read-only
onFullscreenError
ElementStream
<
Event
>
Inherited
read-only
inputMethodContext
InputMethodContext
Inherited
read-only
isContentEditable
bool
Inherited
read-only
Instance Methods
setInnerHtml
(
String
html
, {
NodeValidator
validator
,
NodeTreeSanitizer
treeSanitizer
} ) →
void
An override to place the contents into content rather than as child nodes.
toString
Inherited
( ) →
String
The string representation of this element.
addEventListener
Inherited
(
String
type
,
dynamic
listener
(
Event
event
)
, [
bool
useCapture
] ) →
void
removeEventListener
Inherited
(
String
type
,
dynamic
listener
(
Event
event
)
, [
bool
useCapture
] ) →
void
dispatchEvent
Inherited
(
Event
event
) →
bool
remove
Inherited
( ) →
void
Removes this node from the DOM.
replaceWith
Inherited
(
Node
otherNode
) →
Node
Replaces this node with another node.
insertAllBefore
Inherited
(
Iterable
<
Node
>
newNodes
,
Node
refChild
) →
Node
Inserts all of the nodes into this node directly before refChild.
append
Inherited
(
Node
newChild
) →
Node
Adds a node to the end of the child
nodes
list of this node.
clone
Inherited
(
bool
deep
) →
Node
Returns a copy of this node.
contains
Inherited
(
Node
other
) →
bool
Returns true if this node contains the specified node.
hasChildNodes
Inherited
( ) →
bool
Returns true if this node has any children.
insertBefore
Inherited
(
Node
newChild
,
Node
refChild
) →
Node
Inserts all of the nodes into this node directly before refChild.
querySelectorAll
Inherited
(
String
selectors
) →
ElementList
<
Element
>
Finds all descendent elements of this element that match the specified group of selectors.
query
Inherited
(
String
relativeSelectors
) →
Element
Alias for
querySelector
. Note this function is deprecated because its semantics will be changing in the future.
queryAll
Inherited
(
String
relativeSelectors
) →
ElementList
<
Element
>
Alias for
querySelectorAll
. Note this function is deprecated because its semantics will be changing in the future.
getNamespacedAttributes
Inherited
(
String
namespace
) →
Map
<
String
,
String
>
Gets a map for manipulating the attributes of a particular namespace.
getComputedStyle
Inherited
( [
String
pseudoElement
] ) →
CssStyleDeclaration
The set of all CSS values applied to this element, including inherited and default values.
appendText
Inherited
(
String
text
) →
void
Adds the specified text after the last child of this element.
appendHtml
Inherited
(
String
text
, {
NodeValidator
validator
,
NodeTreeSanitizer
treeSanitizer
} ) →
void
Parses the specified text as HTML and adds the resulting node after the last child of this element.
attached
Inherited
( ) →
void
Called by the DOM when this element has been inserted into the live document.
detached
Inherited
( ) →
void
Called by the DOM when this element has been removed from the live document.
enteredView
Inherited
( ) →
void
Deprecated*: override
attached
instead.
leftView
Inherited
( ) →
void
Deprecated*: override
detached
instead.
attributeChanged
Inherited
(
String
name
,
String
oldValue
,
String
newValue
) →
void
Called by the DOM whenever an attribute on this has been changed.
scrollIntoView
Inherited
( [
ScrollAlignment
alignment
] ) →
void
Scrolls this element into view.
insertAdjacentHtml
Inherited
(
String
where
,
String
html
, {
NodeValidator
validator
,
NodeTreeSanitizer
treeSanitizer
} ) →
void
Parses text as an HTML fragment and inserts it into the DOM at the specified location.
matchesWithAncestors
Inherited
(
String
selectors
) →
bool
Checks if this element or any of its parents match the CSS selectors.
offsetTo
Inherited
(
Element
parent
) →
Point
Provides the offset of this element's
borderEdge
relative to the specified parent.
createFragment
Inherited
(
String
html
, {
NodeValidator
validator
,
NodeTreeSanitizer
treeSanitizer
} ) →
DocumentFragment
Create a DocumentFragment from the HTML fragment and ensure that it follows the sanitization rules specified by the validator or treeSanitizer.
animate
Inherited
(
Object
effect
, [
Object
timing
] ) →
AnimationPlayer
blur
Inherited
( ) →
void
createShadowRoot
Inherited
( ) →
ShadowRoot
focus
Inherited
( ) →
void
getAnimationPlayers
Inherited
( ) →
List
<
AnimationPlayer
>
getAttribute
Inherited
(
String
name
) →
String
getAttributeNS
Inherited
(
String
namespaceURI
,
String
localName
) →
String
getBoundingClientRect
Inherited
( ) →
Rectangle
Returns the smallest bounding rectangle that encompasses this element's padding, scrollbar, and border.
getClientRects
Inherited
( ) →
List
<
Rectangle
>
Returns a list of bounding rectangles for each box associated with this element.
getDestinationInsertionPoints
Inherited
( ) →
List
<
Node
>
Returns a list of shadow DOM insertion points to which this element is distributed.
getElementsByClassName
Inherited
(
String
classNames
) →
List
<
Node
>
Returns a list of nodes with the given class name inside this element.
insertAdjacentElement
Inherited
(
String
where
,
Element
element
) →
Element
insertAdjacentText
Inherited
(
String
where
,
String
text
) →
void
matches
Inherited
(
String
selectors
) →
bool
requestFullscreen
Inherited
( ) →
void
requestPointerLock
Inherited
( ) →
void
setAttribute
Inherited
(
String
name
,
String
value
) →
void
setAttributeNS
Inherited
(
String
namespaceURI
,
String
qualifiedName
,
String
value
) →
void
querySelector
Inherited
(
String
selectors
) →
Element
Finds the first descendant element of this element that matches the specified group of selectors.
click
Inherited
( ) →
void