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

@whjvenyl/angular-xxl

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@whjvenyl/angular-xxl

This library contains a couple of decorators which provide functionality useful for angular components.

  • 1.0.7
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

This library contains a couple of decorators which provide functionality useful for angular components.

CircleCI Coverage Status GitHub issues

The following decorators are available

This library can be installed using yarn

$> yarn add angular-xxl

Below is a short description of each @decorator

@HostElement

This decorator monitors dimensions (width/height) of elements; The root element of the component and/or any of its children

    @HostElement('width') width$: Observable<number>;
    @HostElement('width', {observable: false}) width: number;
    @HostElement('height', 'width'}) size$: Observable<{height: number, width: number};

Read more

DEMO

@RouteData / @RouteParams / @RouteQueryParams

These decorators let you access the router's data, params and queryParams easily with just one line of code.

@Component({
    selector: 'app-contacts',
    templateUrl: './contacts.component.html',
    styleUrls: ['./contacts.component.scss']
})
export class ContactsComponent implements OnInit {
    @RouteData() contacts$: Observable<Contact[]>;
    @RouteParams('contactId', { observable: false}) contactId: string;
    @RouteQueryParams('search', { pipe: [map( x => x * 10)]}) search$: Observable<string>;
    
    constructor(private route: ActivatedRoute) {} // The `route` is required!
    
    ngOnInit(): void {} // This is required too
}

There is some flexibility in how the data is received in the component which is all described in more detail here.

Read more

Demo

Tunnel

This decorator allows you to setup communication between instances of the same components/class.

Read more

DEMO

TODO

  • Write polyfill for size-change detection using this

Contributors

  • @dirkluijk - Suggested to solve the issue using decorators
  • @superMDguy - Added @RouteQueryParams() and an option to return actual values instead of Observables

Keywords

FAQs

Package last updated on 18 Feb 2019

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