Skip to content

Instantly share code, notes, and snippets.

View fabionogueira's full-sized avatar

Fabio Nogueira fabionogueira

View GitHub Profile
export class CustomElementUtil {
/**
* workaround for @containerless subclasses (custom elements) - waiting for https://github.com/aurelia/templating/issues/140
* @return previousElementSibling when given element is comment node (as it is in case of @containerless custom elements) or given element otherwise
*/
public static getRealElement(element: Element): Element {
if(element.nodeType === 8) {
element = this.getPreviusElementSibling(element)
}