Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ngx-ordered-initializer

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ngx-ordered-initializer

An Angular DI token that you can use to provide one or more initialization functions that will be executed in order

  • 2.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
190
decreased by-12.04%
Maintainers
1
Weekly downloads
 
Created
Source

ngx-ordered-initializer

An Angular DI token that you can use to provide one or more initialization functions that will be executed in order

Installation

npm install ngx-ordered-initializer

Versions

  • Angular 11: 1.0.0
  • Angular 12: 2.0.0

Usage

import { APP_INITIALIZER, NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import {
  ORDERED_APP_INITIALIZER,
  ORDERED_APP_PROVIDER,
} from 'ngx-ordered-initializer';
import { AppComponent } from './app.component';

@NgModule({
  declarations: [AppComponent],
  imports: [BrowserModule, HttpClientModule],
  providers: [
    {
      provide: ORDERED_APP_INITIALIZER,
      useFactory: initializer1,
      multi: true,
    },
    {
      provide: ORDERED_APP_INITIALIZER,
      useFactory: initializer2,
      multi: true,
    },
    ORDERED_APP_PROVIDER,
  ],
  bootstrap: [AppComponent],
})
export class AppModule {}

The ORDERED_APP_PROVIDER will ensure that each initializer provided as ORDERED_APP_INITIALIZER will be executed in the declaration order.

Demo

https://stackblitz.com/edit/ngx-ordered-initializer-demo

Keywords

FAQs

Package last updated on 07 Sep 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc