-
Notifications
You must be signed in to change notification settings - Fork 6
Home
Alfredo Barron edited this page Oct 14, 2015
·
8 revisions
##Required
- Download the latest release
- Clone the repo:
git clone https://github.com/Modulr/angular-file.git
. - Install with Bower:
bower install angular-file
. - Install with npm:
npm install angular-file
.
##What's included
angular-file/
├── angular-file.css
├── angular-file.min.css
├── angular-file.js
└── angular-file.min.js
##Usage
###Load CSS
<link rel="stylesheet" href="bower_components/angular-file/dist/angular-file.min.css">
###Load JS
<link rel="stylesheet" href="bower_components/angular-file/dist/angular-file.min.js">
###Code
var myAppModule = angular.module('MyApp', ['mdr.file'])
###HTML View or Templates
Simple
<mdr-file url="upload.php"></mdr-file>
Complete
<mdr-file url="upload.php" mode="modelo" headers="{token:'shhh'}" size="5" limit="10" formats="'jpg,png,gif'" disabled="true" multiple="false" text="Arrastra o haz clic aquí"></mdr-file>
##API
El parámetro recibido en el servidor es
file
###Attributes
Attribute | Type | Description |
---|---|---|
url | string |
Is the path on the server where the file will be uploaded. |
model | object |
It is the scope model where uploaded files will be saved. |
headers | object |
Send headers to the server. |
size | number |
Max size in MB to file. |
limit | number |
Max number files to upload. |
formats | string,array |
Extensions permitted to the file. |
text | string |
Text into area drag and drop. |
multiple | boolean |
If required to upload a single file this attribute is marked as false, the default value is true. |
disabled | boolean |
If required disable the component is marked as true. |