I am trying to do something like this in Angular javascript (a simplified code):
var modelName = \"date\"; if (attrs.hasOwnProperty(\'today\')) { scope.model
You can access properties of objects using square brackets.
var modelName = "date"; if (attrs.hasOwnProperty('today')) { scope[modelName] = new Date(); }