ember-stargate icon indicating copy to clipboard operation
ember-stargate copied to clipboard

Q: when count eq zero

Open basz opened this issue 5 years ago • 1 comments

Would it be safe to wrap the render in a conditional so it won't output when nothing is added?

https://github.com/kaliber5/ember-stargate/blob/master/addon/components/portal-target.hbs

{{#if this.count}}

<div
  {{did-insert this.register}}
  {{will-destroy this.unregister}}
  ...attributes
>
  {{yield this.count}}
</div>

{{/if}

basz avatar Jul 03 '20 13:07 basz

Hm, I don't think this would work right now, as rendering into the portal target using in-element happens before the portal is registered (so count is still 0). See https://github.com/kaliber5/ember-stargate/blob/master/addon/components/portal.js#L11

simonihmig avatar Jul 09 '20 17:07 simonihmig