1

I have 2 models loaded into my route and am trying to render a component for each into the same template as below:

{{#each fav in favs}}
  {{user-fav fav=fav}}
{{/each}}
{{#each tag in tags}}
  {{user-tag tag=tag}}
{{/each}}

The favs models load fine but the tags gives an error : 'Failed to execute 'createElement' on 'Document': The tag name provided ('telegram-client@model:tag::ember763:JavaScript') is not a valid name.'

If I remove the {{user-tag}} component and insert the HTML its fine and all tags are rendered.

I've deleted the component and generated a new blank one with no html or js with no success. I've also renamed the tagName property to TagId but that doesn't work either.

I've tried {{user-tag tag=tags}} outside the each helper as suggested and that gives a similar error : Failed to execute 'createElement' on 'Document': The tag name provided ('DS.FilteredRecordArray:ember468') is not a valid name. I've also tried rendering it in different components and partials with the same error.

I presume this is a bug in HTMLbars and I'm going to update Ember-cli eventually (I'm using v0.2.3) but any other advice much appreciated.

  • can you also show the `user-tag` component? Does the component work fine outside of `#each` (with data passed into)? – Jeff Aug 23 '15 at 22:23
  • Will you include the html. And potentially the class if it has any logic that's pertinent to the view? – Kingpin2k Aug 24 '15 at 05:12
  • 1
    It's very possible you have a clashing property in your component now that I look at the error. There is a property defined on all components called `tagName` which defines what kind of html tag to use to surround the component. It defaults to `div` but if you have a computed property called `tagName` in your component and it's returning the model or something, it is very likely breaking it. (and it's possible that tag is a reserved word as well, but I'm having to guess since i can't see your user-tag code) – Kingpin2k Aug 24 '15 at 05:16
  • Many thanks @Kingpin2K, I've renamed it to {{user-tag cat=tag}} and that works now, so tag must be a reserved word. – Steve Tyler Aug 24 '15 at 10:49
  • Could you post an answer and accept it if you've solved your problem? – Daniel Kmak Aug 24 '15 at 13:25

1 Answers1

0

I renamed the component to {{user-tag cat=tag}} and that works now, so tag must be a reserved word in Ember components.