Skip to content

Instantly share code, notes, and snippets.

@corrspt
Last active November 19, 2015 08:20
Show Gist options
  • Select an option

  • Save corrspt/b74a3aa9d8108279409f to your computer and use it in GitHub Desktop.

Select an option

Save corrspt/b74a3aa9d8108279409f to your computer and use it in GitHub Desktop.

In no specific order, just things I learned while using Ember.JS

HTMLBars Unsupported Content

TypeError: unsupported content
    at HTMLBarsMorph.Morph$setContent [as setContent] (http://localhost:4200/assets/vendor.js:56201:15)
    at Object.range (http://localhost:4200/assets/vendor.js:54697:13)
    at Object._htmlbarsUtilObjectUtils.merge.content (http://localhost:4200/assets/vendor.js:53624:17)

This error happened in an Integration test of a component that was expecting to have a property 'visualLabel' but instead, in my test setup I created a Jvascript object thas was the following:

let option1 = Ember.Object.create({
    'id': '1',
    'text': 'Option1',
    visualLabel: function () {
      return 'Option1';
    }
  });

Because of that visualLabel being a function, HTMLBars could not render the content (hence the "unsuported content" message). If I changed the visualLabel to be just 'visualLabel': 'Option1' everything worked just fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment