JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 7458
  • Score
    100M100P100Q128514F
  • License MIT

A decorator for watching property change

Package Exports

  • property-watch-decorator

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (property-watch-decorator) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Property Watch Decorator

install

npm install property-watch-decorator --save

Example 1 (General)

class PersonComponent {
  @OnChange(value => console.log('name is changed to: ', value))  
  name: string;
}

Example 2 (Angular)

@Component({
    ...
})
export class MyComponent {
    @OnChange(value => console.log('property1 is changed to', value))
    property1: any;
    
    @OnChange(value => console.log('property2 is changed to', value))
    @Input() 
    property2: any;
}