You can test library on this online example 👌 ngx-jsonapi-material
Data is obtained from Json Api Playground server.
Just install, configure and learn with examples.
First of all, it's advisable to read Jsonapi specification. Understanding JsonApi documents structure is recommended.
yarn add ngx-jsonapi-material --save
# or npm if you wish...
Selector: jam-floating-filters
<jam-floating-filter [hasAdvancedFilters]="false">
<ng-container class="jam-filter-header">
your code...
</ng-container>
</jam-floating-filter>
You can run JsonApi Demo App locally following the next steps:
git clone [email protected]:reyesoft/ngx-jsonapi-material.git
cd ngx-jsonapi-material
yarn
yarn serve
We use as backend Json Api Playground.
yarn cy:run
yarn cy:open
Go to the following location cypress -> integration, and create a file with the extension .spec.ts. The file contains the following structure:
describe('ListBase', () => {
before(() => {
cy.disableScreenshot();
});
it('ListBase integrity test', () => {
cy.spyAuthors();
cy.visit('/#/authors?pageSize=10');
})
});
Go to the following location cypress -> fixtures, and create a file with the extension .json. In it we will have the supposed response from the backend.
{
"meta": {
"page": 1,
"resources_per_page": 10,
"total_resources": 11
},
"data": [
{
"type": "authors",
"id": "14",
"attributes": {
"name": "Anais Carroll",
"birthplace": "Taiwan",
"date_of_birth": "1986-08-12",
"date_of_death": "2000-10-05"
},
"relationships": {
"photos": {
"data": []
},
"books": {
"data": [
{
"type": "books",
"id": "23"
},
{
"type": "books",
"id": "49"
}
]
}
},
"links": {
"self": "/authors/14"
}
}
]
}
Check Environment development file 😉.