fix(core): update
This commit is contained in:
parent
b768896fbe
commit
afa7c2fe61
11
README.md
11
README.md
@ -66,16 +66,19 @@ So to get to get access to a specific collection you document
|
|||||||
@smartdata.Collection(smartdataDb)
|
@smartdata.Collection(smartdataDb)
|
||||||
class MyObject extends smartdata.DbDoc<MyObject> {
|
class MyObject extends smartdata.DbDoc<MyObject> {
|
||||||
// read the next block about DbDoc
|
// read the next block about DbDoc
|
||||||
@smartdata.svDb() property1: string; // @smartdata.svDb() marks the property for db save
|
@smartdata.svDb()
|
||||||
|
property1: string; // @smartdata.svDb() marks the property for db save
|
||||||
|
|
||||||
property2: number; // this one is not marked, so it won't be save upon calling this.save()
|
property2: number; // this one is not marked, so it won't be save upon calling this.save()
|
||||||
constructor(optionsArg: { property1: string; property2: number }) {
|
|
||||||
super();
|
constructor() {
|
||||||
|
super(); // the super call is important ;) But you probably know that.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// start to instantiate instances of classes from scratch or database
|
// start to instantiate instances of classes from scratch or database
|
||||||
|
|
||||||
let localObject = new MyObject({
|
const localObject = new MyObject({
|
||||||
property1: 'hi',
|
property1: 'hi',
|
||||||
property2: 2
|
property2: 2
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user