Skip to content
This repository was archived by the owner on Feb 18, 2026. It is now read-only.
This repository was archived by the owner on Feb 18, 2026. It is now read-only.

Example application to illustrate best practices around domain model and json api #173

@blaur

Description

@blaur

Maybe it is my lack of knowledge but then simply correct me a close the issue.

I have been working quite a bit with Angular 2 (through angular2-jsonapi) but I really want to utilise this project in a new Angular 4 application.

After reading through everything there are a few things that I am missing. How can we easily integrate the ngrx-json-api approach with an existing model (like done with decorators in angular2-jsonapi) without having to write a our own reducers on the side. The intention is of course to have one definition utilised across the entire application (and validated against only that one definition). Or maybe this is not even the intention of this project, or maybe I am getting it all wrong?

I understand we define the model definition in ResourceDefinition but can you somehow decorate existing model objects and utilise that as the resource defintion as the below example:

@JsonApiModelConfig({
    type: 'users'
})
export class User extends JsonApiModel {

	@Attribute()
    name: string;
    // ...
}

Or do we have any examples? I am really looking for best practices here.

Thanks in advance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions