问题
My model (medid) is successfully loaded on my template (medid.hbs) but when I try to put a value from the record in as text it doesn't render anything.
In other templates everything I rendered from the model was in a table iterated on with an {{each}} helper. Here I used {{model.id}} to populate the table rows.
I assumed that I could just use something like 'Hello my name is {{model.id}} but that doesn't work. I'm probably missing something obvious
How do I access my model data for printing outside of a handlebars helper?
回答1:
To retrieve the first item from the array you can use firstObject. so in your case you can access it like {{model.firstObject.id}}
来源:https://stackoverflow.com/questions/47409782/emberjs-how-to-print-values-from-model-outside-of-each-type-functions