I am attempting to achieve a similar functionality in Angular javascript (with simplified code):
var modelName = "date";
if (attrs.hasOwnProperty('today')) {
scope.modelName = new Date();
}
In the scenario above, my intention is for scope.modelName
to automatically become scope.date
. Is there a way to dynamically parse the value of the modelName
variable?