npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

sd-angular-jsonapi

v1.0.0

Published

## THIS DOCUMENTATION IS DEPRECATED *** WAIT FOR NEW DOCUMENTATION PLEASE

Readme

Skyline Dynamics - JSON API - Angular 5 Implementation

THIS DOCUMENTATION IS DEPRECATED *** WAIT FOR NEW DOCUMENTATION PLEASE

Installation

Install the library with the following command:

npm install --save sd-angular-jsonapi

or

yarn add sd-angular-jsonapi

Add the Module to your app.module.ts file:

@NgModule({
  imports: [
    ...
    SDJsonApiModule.forRoot({baseUrl: 'http://yourdomain.com'})
  ],
})

###Configuration

The following configuration options are available when importing the module:

Variable|Required|Type|Default Value|Description :-----:|:-----:|:-----:|:-----:|:-----: baseUrl|Yes|string|empty|The root URL of your API version|No|string|empty|The version identified of your API. If ommitted, no version will be used. Can be any string like 'v1' or '1'

###Resources

####Creating a resource To create a resource, create a class that extends from JSONAPIResource and decorate it with the @JSONAPI() decorator

@JSONAPI()
export class Author extends JSONAPIResource{
  
}

optionally you can define attributes on the class that should be returned by the API. Note that these attributes are only to enable type-hinting in compatible IDE's. The attributes will not actually be used to define the data that will be returned from the API.

####Instantiating a resource Instantiate a resource by calling the new constructor on it:

const author = new Author();

That's it! ####Fetch all resources To fetch all entries of a certain resource, you can call the .all() method, or optionally the .get() method without parameters.

So

author.all();

is the same as

author.get();

Calling the .all() or .get() method on a resource returns an Observable of type Collection that will contain the results of the API call

// TODO error handling is not implemented yet, but if an API call fails, it should return a properly typed ErrorResult

Example for a full call:

// Define the Resource
@JSONAPI()
export class Author extends JSONAPIResource{
  
}

//Instantiate the resource
const authors = new Author();

//Get all authors
authors.all().subscribe(
  (successResult: Collection) => {
    console.log('Loaded the following authors from the API: ' + successResult.all());
  },
  (errorResult) => {
    console.log('Whoops, something went wrong!');
  });

####Fetch a single resource To fetch a single resource, simply call the .get() method on the resource and provide the ID of the resource you'd like to fetch:

// Define the Resource
@JSONAPI()
export class Author extends JSONAPIResource{
  
}

//Instantiate the resource
const authors = new Author();

//Get author with the ID 23
authors.get(23).subscribe(
  (successResult: Collection) => {
    console.log('Loaded the following author from the API: ' + successResult.first());
  },
  (errorResult) => {
    console.log('Whoops, something went wrong!');
  });

Note that, even though we're requesting a single resource, at this time the library will still return a full collection (which only contains the author we requested).

// TODO implement .find(<id>) method, that only returns the resource, not a collection

####Fetch all resources (or a single one) including related data // TODO ####Filter a request You can filter a resource by using the .filter() and .filters() methods on the resource. Note that filters need to be applied BEFORE sending the request, so BEFORE you call .all(), .get() or .find()

// Define the Resource
@JSONAPI()
export class Author extends JSONAPIResource{
  
}

//Instantiate the resource
const authors = new Author();

//Get all authors that are still alive
authors.filter('alive',true).all().subscribe(
  (successResult: Collection) => {
    console.log('Loaded the following authors from the API: ' + successResult.all());
  },
  (errorResult) => {
    console.log('Whoops, something went wrong!');
  });

####Paginate a request // TODO

####Filter returned fields // TODO

###Collections // TODO

###Error Handling // TODO