Skip to content

Commit ade6cce

Browse files
committed
1 parent 31cd7b1 commit ade6cce

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/models/json-api.model.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { ModelConfig } from '../interfaces/model-config.interface';
66
import * as _ from 'lodash';
77
import { AttributeMetadata } from '../constants/symbols';
88
import { HttpHeaders } from '@angular/common/http';
9+
import { JsonApiMetaModel } from '..';
910

1011
/**
1112
* HACK/FIXME:
@@ -24,7 +25,7 @@ export class JsonApiModel {
2425

2526
lastSyncModels: Array<any>;
2627

27-
constructor(private internalDatastore: JsonApiDatastore, data?: any) {
28+
constructor(private internalDatastore: JsonApiDatastore, protected data?: any) {
2829
if (data) {
2930
this.modelInitialization = true;
3031
this.id = data.id;
@@ -33,6 +34,14 @@ export class JsonApiModel {
3334
}
3435
}
3536

37+
get meta(): JsonApiMetaModel {
38+
return new JsonApiMetaModel(this._data);
39+
}
40+
41+
get relationships(): any {
42+
return this._data.relationships;
43+
}
44+
3645
public isModelInitialization(): boolean {
3746
return this.modelInitialization;
3847
}

0 commit comments

Comments
 (0)