Using JavaScript calculated property in UpshotJS

51 Views Asked by At

I'm new to Upshot and can't find a documentation/group for Upshot so I'm posting it in here. I want to have calculated property in my model, is it supported and how can I implement that? For example:

 upshot.metadata({
        "Cocktail:#Cocktail.Models": {
            "key": ["Id"],
            "fields": {
                "Id": { "type": "Int32:#System" },
                "Image": { "type": "String:#System" },

                "HtmlId": { "type": "String:#System"},

                 // Calculated Property
                "DetailUrl": { "type": "String:#System", "value": function(){return 'cocktail' + this.Id;} },
            }
        }
    });
0

There are 0 best solutions below