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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@mbd-common-libs/angular-common-services

v2.60.2

Published

Store models and services for creating a marketplace instance.

Downloads

1

Readme

angular-common-services

Services Built With

About the library

Store models and services for creating a marketplace instance:

  • API services.
    • user authorization.
    • marketplace endpoints.
  • Models :
    • request and response models.
  • Utils:
    • CSRF interceptor. Syncs CSRF token between pages.

Services Dependencies

"jwt-decode": "3.1.2",
"broadcast-channel": "3.5.3",
"isbot": "^3.3.1"

Services Installation

  1. Install dependencies
  npm i --save [email protected] [email protected]
  1. Install library npm i @mbd-common-libs/angular-common-services

Import OcCommonServiceModule

Note: OcCommonServiceModule provide API services.
Add import to app.module

@NgModule({
    imports: [
        ...
        OcCommonServiceModule.forRoot({apiUrl: 'main api path for all API services'}),
    ]
})
export class AppModule {}

Example:

   OcCommonServiceModule.forRoot({apiUrl: 'https://client-api.openchannel.io/'})

Import CustomHttpClientXsrfModule

Note: CustomHttpClientXsrfModule provide CSRF intercepors. Interceptors take CSRF response header, then put it into memory storage and insert this header for all requests by this API URL.

Add import to app.module

@NgModule({
    imports: [
        ...
       CustomHttpClientXsrfModule.withOptions({ headerName: 'X-CSRF-TOKEN', apiUrl: 'main api path for all API calls' }),
    ]
})
export class AppModule {}

Example:

CustomHttpClientXsrfModule.withOptions({ headerName: 'X-CSRF-TOKEN', apiUrl: 'https://client-api.openchannel.io/' })

Import NetlifyPrerenderModule

Note: NetlifyPrerenderModule provide HttpRequestsWatcherInterceptor for the Netlify pre-render.
Add import to app.module

@NgModule({
    imports: [
        ...
        NetlifyPrerenderModule.withOptions({ endpointsConfigForPrerender: 'your pre-render config can be passed here' }),
    ]
})
export class AppModule {}

Example:

   NetlifyPrerenderModule.withOptions({ endpointsConfigForPrerender: yourPrerenderEndpointsConfig }),

Connect library to project by link

Note: Run commands from the root directory.

  1. npm i

  2. ng build angular-common-services --watch

  3. cd ./dist/angular-common-services

  4. sudo npm link Then copy result link.

    • Example:
      • Command Result (sudo npm link):
        /usr/local/lib/node_modules/@mbd-common-libs/angular-common-services -> /home/user/git/angular-template-libraries/dist/angular-common-services
      • Copy link: /home/user/git/angular-template-libraries/dist/angular-common-services
  5. In your angular project run: npm install file:{absolute path to angular-common-services or copied path}/dist/angular-common-services

    • Example: npm install file:/home/user/git/angular-template-libraries/dist/angular-common-services
  6. Use imports into ts files :
    import { CustomHttpClientXsrfModule } from '@mbd-common-libs/angular-common-services';