A directive for creating resizable containers.
All other resizable directive concepts I came across include layout logic in the directive. I wanted a directive that only handled the resize logic. This way, the layout logic is quarantined to the CSS.
bower install angular-resizable
- Include
angluar-resizable.js
in your project. - Include
angluar-resizable.css
in your project as well (this provides default styling for the resize handles). - Then include the module in your app:
angular.module('app', ['angularResizable'])
- Use it:
<section resizable r-directions="['bottom', 'right']" r-flex="true">
Include any sides you want to be resizable in an array inside r-directions
. Accepts 'top','right','bottom', and 'left'
Attribute | Default | Accepts | Description |
---|---|---|---|
r-directions | ['right'] | ['top', 'right', 'bottom', 'left',] | Determines which sides of the element are resizable. |
r-flex | false | boolean | Set as true if you are using flexbox.See the example. |
MIT