Skip to content

Service for querying positional/size information #1089

@mhevery

Description

@mhevery

A service which given a DirectiveRef can return position information about the component.

API

@Componte({ selector: 'some-component' }) @Template(...) class SomeComponent { constructor(ref:ComponentRef, ruler: Ruler) { ruler.measure(ref).then((rect:Rectangle) { rect.top/width/height/etc.. }) } } 

See: https://developer.mozilla.org/en-US/docs/Web/API/Element/getBoundingClientRect

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions