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

@gund/ng-annotations

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

@gund/ng-annotations

Extract metadata of Angular components, directives, service etc.

  • 0.3.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

ng-annotations

Extract metadata of Angular components, directives, service etc.

Travis CI Coverage Npm Npm Downloads semantic-release

Installation

$ npm install --save @gund/ng-annotations

Usage

Import Annotations class first:

import { Annotations } from 'ng-annotations';

Then get annotations for you component:

@Component({selector: 'some-component'})
class MyComponent {
  constructor() {
    const annotations = Annotations.getFor(MyComponent);
    // annotations.selector here will be `some-component`
  }
}

Documentation

Annotations

class Annotations {
  static getFor(type: Type<any>): AllDecorators;
  static getForDirective(type: Type<any>): Directive;
  static getForComponent(type: Type<any>): Component;
  static getForPipe(type: Type<any>): Pipe;
}

See src/annotations.ts for full reference

Description: Class with static methods to get annotations from type.

getFor()

static getFor(type: Type<any>): AllDecorators;

Description: Get annotations for the type. It will return all annotations found. If you want more specific type use methods below.

getForDirective()

static getForDirective(type: Type<any>): Directive;

Description: Get annotations for directive. Calls getFor() but returns type specific for Directive.

getForComponent()

static getForComponent(type: Type<any>): Component;

Description: Get annotations for component. Calls getFor() but returns type specific for Component.

getForPipe()

static getForPipe(type: Type<any>): Pipe;

Description: Get annotations for pipe. Calls getFor() but returns type specific for Pipe.

Development

To generate all *.js, *.js.map, *.d.ts and *.metadata.json files:

$ npm run build

To lint all *.ts files:

$ npm run lint

To run unit tests:

$ npm test

License

MIT © Alex Malkevich

Keywords

FAQs

Package last updated on 14 Apr 2017

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