Skip to content
Alfredo Barron edited this page Oct 14, 2015 · 8 revisions

Welcome to the angular-file wiki!

##Required

Install

  • 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/
  dist/
    ├── angular-file.css
    ├── angular-file.min.css
    ├── angular-file.js
    └── angular-file.min.js

##Usage

####Load CSS

<link href="angular-file/dist/angular-file.min.css">

###Load JS

<script href="angular-file/dist/angular-file.min.js"></script>

####Code

angular.module('MyApp', ['mdr.file'])

####HTML View or Templates

Simple

<mdr-file url="upload.php"></mdr-file>

Complete

<mdr-file url="upload.php" model="miModelo" headers="{token:'shhh'}" size="5" limit="10" formats="'jpg,png,gif'" disabled="true" multiple="false" text="Arrastra o haz clic aquí"></mdr-file>

##API

####Attributes

Attribute Type Description
url string Is the path on the server where the file will be uploaded. Note: The parameter received on the server is file
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.
Clone this wiki locally