Getting data - MurhafSousli/ngx-wordpress GitHub Wiki

There is two options for getting resources in WordPress API, Collection and Model

  • Collection is used to:
    • Get an array of items.
    • Get a single post by slug.

Collection Directive | Collection Service

  • Model is used to:
    • Get a single item by ID.
    • Add a new item.
    • Delete an item by ID.
    • Update an existing item by ID.

Model Directive | Model Service


It is up to you whether you like to use the directive or the service, I personally use the directive since I can get the data from the template also the loading output is very helpful, but both ways are straight forward