{"_id":"ng-resize","_rev":"6-58b29d2d119eefa5cc7555f61181843f","name":"ng-resize","description":"Manage resize events in Angular applications","dist-tags":{"latest":"2.0.0"},"versions":{"1.2.0":{"name":"ng-resize","version":"1.2.0","author":{"name":"Daniel Smith","email":"dannmasta@gmail.com"},"description":"Manage resize events in Angular applications","keywords":["lightweight","ui","resize","angular","javascript"],"main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/danmasta/ng-resize.git"},"dependencies":{},"devDependencies":{"connect":"^3.3.5","gulp":"^3.8.11","gulp-concat":"^2.5.2","gulp-gh-pages":"^0.5.1","gulp-livereload":"^3.8.0","gulp-uglify":"^1.2.0","gulp-util":"^3.0.4","serve-static":"^1.9.2"},"engines":{"node":">=0.10.30","npm":"2.x"},"gitHead":"d81365606822acdb99b7ee961f7d4c3dff6893a6","bugs":{"url":"https://github.com/danmasta/ng-resize/issues"},"homepage":"https://github.com/danmasta/ng-resize#readme","_id":"ng-resize@1.2.0","_shasum":"4e9764228ec2a802f8722d459f9bd1e51aee881c","_from":".","_npmVersion":"2.9.1","_nodeVersion":"0.12.3","_npmUser":{"name":"danmasta","email":"dannmasta@gmail.com"},"dist":{"shasum":"4e9764228ec2a802f8722d459f9bd1e51aee881c","tarball":"https://registry.npmjs.org/ng-resize/-/ng-resize-1.2.0.tgz","integrity":"sha512-KSVr52VNWc7beXu3oLcDPlbMulw3nRcwDMvb21Lgqt5KAOGFfCAb14qc7EnOxwvsp6ubqHETGsVCgKN6oHmORw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHA+ngvwahAXhycpM8GrcRl9uqgT0Z76J9Ujq2QU/NDRAiEAgwKOUDlYc2mIfrEifyf0jGydXOw3wn6w/ss6193Trrw="}]},"maintainers":[{"name":"danmasta","email":"dannmasta@gmail.com"}],"directories":{}},"1.3.0":{"name":"ng-resize","version":"1.3.0","author":{"name":"Daniel Smith","email":"dannmasta@gmail.com"},"description":"Manage resize events in Angular applications","keywords":["lightweight","ui","resize","angular","javascript"],"main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/danmasta/ng-resize.git"},"dependencies":{},"devDependencies":{"express":"^4.15.2","gulp":"^3.9.1","gulp-concat":"^2.6.1","gulp-gh-pages":"^0.5.4","gulp-livereload":"^3.8.1","gulp-ng-annotate":"^2.0.0","gulp-uglify":"^2.1.2"},"engines":{"node":">=0.10.30","npm":"2.x"},"gitHead":"a826595d744bd0b992459f8567585011ec1d4f0e","bugs":{"url":"https://github.com/danmasta/ng-resize/issues"},"homepage":"https://github.com/danmasta/ng-resize#readme","_id":"ng-resize@1.3.0","_shasum":"8b13c1a0e2da971b02c972bf18de3a9763739f71","_from":".","_npmVersion":"3.10.10","_nodeVersion":"6.9.3","_npmUser":{"name":"danmasta","email":"dannmasta@gmail.com"},"dist":{"shasum":"8b13c1a0e2da971b02c972bf18de3a9763739f71","tarball":"https://registry.npmjs.org/ng-resize/-/ng-resize-1.3.0.tgz","integrity":"sha512-7TDyLXyjjthWNCUkYiOINELfwzIyUvcPM2DrQMFbhyjN/qp1s35rClbFCcx82YPoU5HTVXk+kAu4Kk8B223TCA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBp3vtcB/K83wgzZAsygYs58N0Fh/AswcQFAs/6gUM3oAiAdanwa6Dr2Pw35jftNTty1VsUovjbR9049tdU7YlqDpQ=="}]},"maintainers":[{"name":"danmasta","email":"dannmasta@gmail.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/ng-resize-1.3.0.tgz_1492295009105_0.047219252679497004"},"directories":{}},"2.0.0":{"name":"ng-resize","version":"2.0.0","author":{"name":"Daniel Smith","email":"dannmasta@gmail.com"},"description":"Manage resize events in Angular applications","license":"MIT","keywords":["lightweight","ui","resize","angular","javascript"],"main":"index.js","scripts":{"test":"echo Error: no test specified"},"repository":{"type":"git","url":"git+https://github.com/danmasta/ng-resize.git"},"dependencies":{},"devDependencies":{"eslint-config-standard":"^11.0.0","eslint-plugin-import":"^2.11.0","eslint-plugin-node":"^6.0.1","eslint-plugin-promise":"^3.7.0","eslint-plugin-standard":"^3.1.0","express":"^4.15.2","gulp":"^3.9.1","gulp-concat":"^2.6.1","gulp-gh-pages":"^0.5.4","gulp-livereload":"^3.8.1","gulp-ng-annotate":"^2.0.0","gulp-uglify":"^2.1.2"},"engines":{"node":">=0.10","npm":">=2"},"gitHead":"3909f674a3c44fda57dc46d7fc3cd5c9a8562df7","bugs":{"url":"https://github.com/danmasta/ng-resize/issues"},"homepage":"https://github.com/danmasta/ng-resize#readme","_id":"ng-resize@2.0.0","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"danmasta","email":"dannmasta@gmail.com"},"dist":{"integrity":"sha512-0bDymacQyEj53YgyHVtXX5/ZT1Ffidmz4xmJMXWK3IXNS23rmjgirqyeJ464C0DB7ggPKJlH1ZPS01qXKR//4Q==","shasum":"66482ad1c12e4960d67b85f86ef172f06552784d","tarball":"https://registry.npmjs.org/ng-resize/-/ng-resize-2.0.0.tgz","fileCount":12,"unpackedSize":16432,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa90ThCRA9TVsSAnZWagAAlEcP/0gFu406rYJhBumpRWZF\nhM2J+SU7iy1TV5VQ06GgLZuyU5Hrla0JtKUOw30qJ9GSl90w/E9uTbVzykUs\nrITdZ8LEAtAifmTIbEMLKFMXR4buj/EPVhN+DlZB5A7kfUQ9EHb3cZX1KDRf\n0GBAbvLv5ZUbbRXD5Nr2fNAidG1It+OC/pEu2yzR3ONUwQAyiodvDunCjNnS\nSD5OhCdVGCr/f3kvtltsW9oOyFGbMEiMgH/ZMwTf5M8IKOjqkLRo+OXVBrvd\nOTcC1KYDc7iAmkgeHAZcka1ybVTIJjl3sj2S81b4YJu8Uh5hdBp5f334X53v\nGqrCQGB8KEEkYcAEfoYxKvQGiHAsOtWoJAmoELGHyBEsxXDpUwBgYQGky1T3\nW0H/dwx7wedUJxsjpd0MeuIsE2orQHRdbNJodpC0YALv6UtaPYOpsHP2K++j\nTkVjUuA956OTyU0QAehxbNtJKIizh7TYh6QrNEGWQ+z3TujVEBN+VLmKZt9/\nqovAVQpNZdr4jbyNWRGuQXSMjQdIg+jvhnObCA8LusxRMN+RaHBsvskDTcCY\nRm3AnjQwgLSIhNoMeunQULpRPkScAJkyzGOYraf1NtpcSnbV9eMm5+5xRK1G\nRGJlJrcgqBFZTF9XSMf/NodsX/d4cjnSKKhM1i9o8SU+5qsVwFE3Dfoga6Ev\noLJT\r\n=dHhx\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDQ/65WjAkX4W5OEbVF66zVRHy9jUZE4eDwin3+0+O7+wIhAMlHlqik13rZGN4AmMZ+A08cfU11mflB/rZBjeMRTTSo"}]},"maintainers":[{"name":"danmasta","email":"dannmasta@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ng-resize_2.0.0_1526154463926_0.8645506469337843"},"_hasShrinkwrap":false}},"readme":"# ngResize\n\nAngular module for managing resize events in your applications. Some of goals of this project worth noting include:\n\n* Lightweight, flexible and easy to use\n* Bind resize event handler one time for entire app\n* Throttle window resize events\n\n## Usage\nngResize is composed of a `provider`, a `service`, and a `directive`. The service can be injected into other modules and used to programatically bind `resize` events in angular applications. The `provider` can be injected into your app's configuration phase to set things like throttle time.\n\nSet `ngResize` as a dependency in your module:\n\n```javascript\nvar app = angular.module('YourApp', ['ngResize']);\n```\n\n### Provider\n```javascript\napp.config(function(resizeProvider) {\n\n    // set throttle time\n    resizeProvider.throttle = 100;\n\n    // don't bind resize events on service initialization\n    resizeProvider.initBind = false;\n\n});\n```\n\n#### Properties\nname | description\n---- | ----\n`throttle` | Throttle time for resize events, default is `32` (30 fps)\n`initBind` | Boolean to determine if we should bind resize event when service object is created, default is `true`\n\n### Service\n```javascript\napp.directive('someDirective', function(resize) {\n    return {\n        controller: function($scope) {\n\n        },\n        link: function($scope, $elem, $attr, ctrl) {\n\n            // on resize event, set dimensions\n            // $event, and data arguments are available\n            $scope.$on('resize', function($event, data) {\n                $scope.width = data.width;\n                $scope.height = data.height;\n            });\n\n        }\n    };\n});\n```\n*The event listener callback accepts two arguments: `$event`, and `data`*\n\n#### Methods\nname | description\n---- | ----\n`getThrottle()` | Returns current throttle time\n`setThrottle(integer)` | Sets current throttle time, applies to entire app\n`trigger([$scope])` | `$broadcast` a `resize` event from specified `$scope` or `$rootScope`\n`bind()` | Bind resize event to `$window`, only useful if `initBind = false` or if event has been previously unbound\n`unbind()` | Unbinds `resize` even from `$window`\n\n### Directive\nSomething worth noting is that when the `resize` event is triggered, `$timeout` is used to debounce the expression to the end of the current `$digest`. This is to try and ensure that any costly calculations you might be doing won't interfere with the current `$digest` cycle. This approach was taken because resize events are often not critical functionality points, but necessary to maintain ui/ux stability. The goal is to provide efficient, useful access to `resize` events without crippling the ui.\n\n```html\n<div ng-resize=\"setDimensions($event, data)\"></div>\n```\n*Two arguments are available to directive expressions: `$event`, and `data`*\n\n## Roadmap\nA few things I'm interested in pursuing with this project in the future are:\n\n* option to disable `$rootScope` `$broadcast`\n* ability to subscribe and unsubscribe `$scopes` from resize `$broadcast`\n* ability to bind `resize` events to `$elements`\n* manage detaching of `$scopes` and `$elements` when `$destroyed`\n* set unique throttle time for each `$scope` or `$element`\n","maintainers":[{"name":"danmasta","email":"dannmasta@gmail.com"}],"time":{"modified":"2022-06-21T04:26:59.581Z","created":"2015-10-09T03:46:17.469Z","1.2.0":"2015-10-09T03:46:17.469Z","1.3.0":"2017-04-15T22:23:30.960Z","2.0.0":"2018-05-12T19:47:44.031Z"},"homepage":"https://github.com/danmasta/ng-resize#readme","keywords":["lightweight","ui","resize","angular","javascript"],"repository":{"type":"git","url":"git+https://github.com/danmasta/ng-resize.git"},"author":{"name":"Daniel Smith","email":"dannmasta@gmail.com"},"bugs":{"url":"https://github.com/danmasta/ng-resize/issues"},"readmeFilename":"README.md","license":"MIT"}