StickyElementDirective class

A directive to sticky an Element.

Example use:

<div [acxStickyElement]="endsticky">
  Your awesome content
</div>
Other awesome content
<div #endsticky></div> <!-- Where sticky should end -->

Note that adding the acxStickyElement to an element that has ngIf has been known to not work correctly. Suggestion is to have the ngIf and acxStickyElements on different html elements (i.e., add an extra outer div for the ngIf).

Annotations
  • @Directive.new(selector: '[acxStickyElement]')

Constructors

StickyElementDirective(ScrollHost _scrollHost, Element _stickyElement)

Properties

endElement Element
The end element that determines the range of the sticky element.
no getter
hashCode int
The hash code for this object.
no setterinherited
position StickyPosition
Whether element should stick to top or bottom of sticky range.
no getter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
sticky bool
Whether to stick the element.
no getter
stickyClass String
Optional css class to use when element is stuck.
no getter
stickyKey String
If stickyKey is provided, then only the last (when position is top) or the first (when position is bottom) sticky element with the same stickyKey will be stuck.
no getter

Methods

ngAfterViewInit() → void
ngOnDestroy() → void
Executed before the directive is removed from the DOM and destroyed.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited