File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ import { ModelConfig } from '../interfaces/model-config.interface';
66import * as _ from 'lodash' ;
77import { AttributeMetadata } from '../constants/symbols' ;
88import { 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 }
You can’t perform that action at this time.
0 commit comments