jeudi 29 août 2019

Retrieve model's property value using a dynamic variable

I want to retrieve a property of a model which has been set dynamically based upon the user which has logged in to the system, in my hbs file.

Suppose fromReports is a property I have set dynamically in the model
,it could be model.fromInstruments for another user
Given, model.fromReports=false or model.fromInstruments =false
and I have var x= fromReports or var x= fromInstruments
I want to get value of model.x in my hbs 

I should get the value as false as both model.fromReports and model.fromInstruments is false




Aucun commentaire:

Enregistrer un commentaire