dcousens on point-readme-to-ks6
dcousens on master
Point keystone-classic readme t… don't dance around the wording Merge pull request #5008 from k… (compare)
dcousens on point-readme-to-ks6
don't dance around the wording (compare)
Noviny on point-readme-to-ks6
Point keystone-classic readme t… (compare)
bladey on master
Update README.md (compare)
bladey on master
Update README.md (compare)
const obj = { greeting: { action: 'hello', object: 'world' } }
const { greeting } = obj
greeting.object = 'you'
console.log(obj.greeting) // {action: "hello", object: "you"}
var locals = res.locals
then modifying locals
will also modify res.locals
because you only copied over the reference to the object rather than the object itself. If you want to make a copy of res.locals to a variable called locals and modify that without also modifying the original, you want to use the following code:var locals = Object.assign({}, res.locals);
Object.assign(...)
takes the first object and assigns values from all objects following it to that value. In this case, we're copying the values of res.locals
to the empty object {}
, effectively copying all the values of res.locals
into a new object
Research.add({
title : {type : String, required : true},
state : {type : Types.Select, options : 'Submitted, Ongoing , Completed',default : 'Submitted'},
principalInvestigator : {type : String},
coInvestigator : {type : String},
fundingAgency : {type : String},
sanctionedAmount : {type : Number,note:'lakhs'},
from : {type : Types.Date},
to : {type : Types.Date},
});