Code Monkey home page Code Monkey logo

ngx-jsonapi-material's Introduction

ngx-jsonapi-material

angular jsonapi

CircleCI Codacy Badge npm version Coverage Status

This is a library (Angular 6+) of components based on Angular material, which makes use of jsonapi to work. ## Online demo

You can test library on this online example ๐Ÿ‘Œ ngx-jsonapi-material

demo

Data is obtained from Json Api Playground server.

Usage

Just install, configure and learn with examples.

First of all, it's advisable to read Jsonapi specification. Understanding JsonApi documents structure is recommended.

Installation

yarn add ngx-jsonapi-material --save
# or npm if you wish...

Directives

JamFloatingFilters

Selector: jam-floating-filters

Simple floating filters

<jam-floating-filter [hasAdvancedFilters]="false">
    <ng-container class="jam-filter-header">
        your code...
    </ng-container>
</jam-floating-filter>

more info

Local Demo App

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.

Running cypress test in console

yarn cy:run

Running cypress test in browser

yarn cy:open

Creating a test

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');
    })
});

Simulate backend response in cypress

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"
            }
        }
    ]
}

Colaborate

Check Environment development file ๐Ÿ˜‰.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.