1.1.0 • Published 8 years ago

angular2-dimensions-directive v1.1.0

Weekly downloads
4
License
MIT
Repository
github
Last release
8 years ago

angular2-dimensions-directive

Fires an Event with the (initial) dimensions of a DOM element and also whenever the dimensions change

npm version

forthebadge

Install

npm i angular2-dimensions-directive --save

Import the directive to your project and use it in your Component defining an event handler that is called whenever the dimensions of the element change

import { DimensionsDirective } from 'angular2-clickoutside-directive';

@Component({
  selector: 'my-app',
  template : `
  <div clickOutside (onDimensionsChange)="onDimensionsChangeHandler($event)"">
    A button
  </button>`,
  directives : [  ClickOutsideDirective ]
} )
class MyFirstComponent implements OnInit {
  constructor(){}

  onDimensionsChange($event)
  {
    console.log( $event.dimensions )
  }

  ngOnInit(){}
}

Contribute

Any pull-request is more than welcome :boom: :smile:

This project adheres to the Contributor Covenant code of conduct. By participating, you are expected to uphold this code.

License

MIT