Skip to content
This repository was archived by the owner on Apr 5, 2023. It is now read-only.
This repository was archived by the owner on Apr 5, 2023. It is now read-only.

Using a popover's contentViewClass with ember-cli #103

@jkatsnelson

Description

@jkatsnelson

Hi there,

As it is currently written, ember-widgets resolves views in a way that isn't very compatible with ember-cli:

from popover-link-popover.hbs:

<div class="popover-content">
  {{view view._contentViewClass}}
</div>

from popover_link.coffee:

  _contentViewClass: Ember.computed ->
    contentViewClass = @get 'contentViewClass'
    if typeof contentViewClass is 'string'
      return Ember.get contentViewClass
    contentViewClass
  .property 'contentViewClass'

I couldn't figure out any way to resolve an ember-cli view via Ember.get contentViewClass

But, there is a very easy workaround...here is an example:

{{#popover-link-component tagName="button"
  class="btn btn-primary" placement="bottom-left"
  _contentViewClass="custom-popover-content"}}
  Show Popover Button-Left
{{/popover-link-component}}

The key thing to notice is that I am overriding the computed property and just telling the component explicitly where to find the view using {{view 'custom-popover-content'}}

If the maintainers would like, I could add this to the README as a gotcha...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions