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

@hqjs/babel-plugin-add-decorators-metadata

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@hqjs/babel-plugin-add-decorators-metadata

Add decorators metadata

  • 0.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

babel-plugin-add-decorators-metadata

Add decorators metadata

Installation

npm install hqjs@babel-plugin-add-decorators-metadata

Usage

{
  "plugins": [["hqjs@babel-plugin-add-decorators-metadata"]]
}

Transformation

Transforms decorators into class metadata, takes care of wrapping providers property into an object. This transformations allow angular to use dependency injection.123

So the code

import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import {CoreConfig} from './app.service';

import { AppComponent } from './app.component';

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule
  ],
  providers: [
    CoreConfig
  ],
  bootstrap: [AppComponent]
})
export class AppModule { }

will turn into

import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { CoreConfig } from './app.service';
import { AppComponent } from './app.component';
@NgModule({
  declarations: [AppComponent],
  imports: [BrowserModule],
  providers: [{
    provide: CoreConfig
  }],
  bootstrap: [AppComponent]
})
export class AppModule {}
AppModule.decorators = [{
  type: NgModule,
  args: [{
    declarations: [AppComponent],
    imports: [BrowserModule],
    providers: [{
      provide: CoreConfig
    }],
    bootstrap: [AppComponent]
  }]
}];

Keywords

FAQs

Package last updated on 23 Sep 2020

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