Is it possible to have a dynamic title title attribute?

{{#linkTo "route" model title=model.title}}model.title{{/linkTo}} 

This gives the a tag the value of the header "model.title". I want to iterate over the list of models and display a link with a unique name for each.

Can this be done?

+4
source share
1 answer

Based on @guleria's comment and for the answer to this question I will give an answer.

 {{#linkTo "route" model titleBinding=model.title}}model.title{{/linkTo}} 

Providing Binding as a suffix for your properties will allow binding. As for where this is described, here is an excerpt from the documentation :

Properties ending with the Binding suffix will be converted to Ember.Binding instances. The value of this property should be a string representing the path to another object or user binding created using the Binding helpers.

Hope this helps.

+8
source

Source: https://habr.com/ru/post/1494874/


All Articles