trotyl / ng-vdom

(Developer Preview) A virtual-DOM extension for Angular, also work as React bridge.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Feature: option to render in sibling position

trotyl opened this issue · comments

Current

Angular component always contains a host element, and Renderable always render content in child position.

Expected

Provide an option to render content in sibling position:

import { Renderable } from 'ng-renderable'

@Component({
  selector: 'my-comp'
})
class MyComponent extends Renderable {
  constructor(injector: Injector) {
    super(injector, { sibling: true })
  }

  render() {
    return <p>42</p>
  }
}

Resulting to:

<my-comp></my-comp>
<p>42</p>