angular2-extensible-decorators

1.0.2 • Public • Published

Angular 2 property decorators

The purpose of this project is to provide extensible property decoration for Angular 2.

Example

The properties shortDescription and sourceCode will be automatically serialized and deserialized to window.localStorage.

import { Component } from '@angular/core';
import { LocalStorage, SessionStorage } from 'angular2-extensible-decorators/components';

@Component({
    selector: 'app-shell',
    template: '...'
})
export class AppComponent {
    @LocalStorage('XYZ') shortDescription: string;
    @LocalStorage('XYZ') sourceCode: string;
	@SessionStorage('XYZ') shortDescription: string;
    @SessionStorage('XYZ') sourceCode: string;
}

Package Sidebar

Install

npm i angular2-extensible-decorators

Weekly Downloads

1

Version

1.0.2

License

MIT

Last publish

Collaborators

  • afgbeveridge