trotyl / ng-vdom

(Developer Preview) A virtual-DOM extension for Angular, also work as React bridge.
259 stars 12 forks source link

Feature: option to render in sibling position #40

Open trotyl opened 5 years ago

trotyl commented 5 years ago

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>