Home AngularJS inverse transclusion

# AngularJS inverse transclusion

Stnaire
1#
Stnaire Published in 2017-11-14 17:29:17Z
 I have a multilingual app running on Angular 1.5.9 and Angular Material. I would like to display all available translations for each translated field of a form in a generic way. The idea is to display a button next to every field that changes value between languages. Because there is some logic to do so, I've created a component that wrap the input field to display 2 new elements : a button to toggle the display of translations the translations (a div for each language containing the translated text) Here a simplified sample of what I've got (comments have been added to clarify the need): 
This field is required.
 So in short, I need to "split" the template of cem-multilingual-form-field in two parts and define where each of them should go in the parent template. The template could look like this:  Toggle
{{ ::label }}
{{ ::$ctrl.parent.getStoreResponse(locale).item[$ctrl.name] }}
 Is it even possible? If not, do you see a better way to achieve the same result? I thought about making a directive and manipulate the DOM manually in the link function but it's really ugly (if even possible, I didn't try yet). Thanks for your help.
 You need to login account before you can post.
Processed in 0.312317 second(s) , Gzip On .