angular directives and services
#Usage
bower install eaModule
angular.module('appName', ['ea-directives', 'ea-services'])
#Directives
Compare to values and add it in the form validation
- ea-value-match: Name of the other value.
<input type="text" name="input1" ng-model="input1">
<input type="text" name="input2" ng-model="input2" ea-value-match="input1">
<div class="form-group has-error">
<p class="help-block" ng-show="form.input2.$error.valueMatch">
Values different
</p>
</form>
===
Create and handle the file input
- scope-var: Scope var that will be replaced with the file once is selected.
- on-file-picked: Function executed when a file is selected.
<input type="file" ea-input-file scope-var="scopeVar" on-file-picked="onFilePicked">
===
Create a drop container for images, handle the file input and create a thumbnail from canvas.
- scope-var: Scope var that will be replaced with the file once is selected.
- on-file-picked: Function executed when a file is selected.
- canvas-width: Max width for the thumbnain.
- canvas-height: Max height for the thumbnail.
- show-thumbnail: Boolean value default true, if true render the canvas in the drop container.
- default-preview: Img to show in the container
<input type="file" ea-drop-container scop-var="scopeVar" on-file-picked="onFilePicked">
- .ea-drop-container
- .ea-drop-plus
- .drop
- .drop input
Change the src of the image if is not found
<img src="image.jpg" ea-on-src-error="noImage.jpg">
Change the src of the image if is not found
- [big-img]: image to show in full screen
- [showFullScreen($event)]: when is clicked will show the fullscreen image
<img src="thumnail.png" alt="" ea-img-full-screen big-img="imgBig.png">
<button class="btn btn-primary" ng-click="showFullScreen($event)">FullScreen</button>
- .eaimgFullScreen
Execute a function when is clicked outside the element
<div ea-on-click-outside="eventHandler()">
</div>
Filter of componets with animation when change
- ea-block-filter: Parent of collection on element
- list: collection to $whatch and recompute the styles
- data-group:array of the groups:
<nav>
<a ng-class="{active: (filtering=='')}" ng-click="noFilter()">All</a>
<a ng-class="{active: (filtering=='filter')}" ng-click="filter('filter')">Filter</a>
</nav>
<div ea-blocks-filter list-items="items">
<div class="col-md-1" ng-repeat="item in items" data-group="{{item.filter}}">
</div>
</ul>