1.0.5 • Published 8 years ago

mdr-angular-file v1.0.5

Weekly downloads
1
License
MIT
Repository
-
Last release
8 years ago

Angular File

Angular File is an Angularjs component that can upload files via XMLHttpRequest, provides drag & drop support.

npm.io

##Features

  • Uses the native Angularjs scope for data binding
  • Drag & Drop
  • Multiple or single files uploads
  • Image preview
  • Update progress
  • Large files support

##Requirements

##Quick start

Several quick start options are available:

  • Download the latest release
  • Clone the repo: git clone https://github.com/Modulr/mdr-angular-file.git.
  • Install with Bower: bower install mdr-angular-file.
  • Install with npm: npm install mdr-angular-file.

##What's included

mdr-angular-file/
  dist/
    ├── mdr-file.css
    ├── mdr-file.min.css
    ├── mdr-file.js
    └── mdr-file.min.js

##Documentation

####Usage

######Load CSS

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

######Load JS

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

######Code

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

######HTML View or Templates

Basic Directive

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

Complete Directive (All attributes)

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

####API

######Attributes

AttributeTypeDescription
urlstringIs the path on the server where the file will be uploaded. Note: The parameter received on the server is file
modelobjectIt is the scope model where will be received to response the server.
dataobjectData to be sent to the server.
headersobjectSend headers to the server.
sizenumberMax size in MB to file.
limitnumberMax number files to upload.
formatsstring,arrayExtensions permitted to the file.
multiplebooleanIf required to upload a multiple file is marked as true.
disabledbooleanIf required disable the component is marked as true.
textstringText into area drag and drop.

##How to contribute

All contributions are very welcome, We love it. There are several ways to help out:

  • Create an issue on GitHub, if you have found a bug
  • Write test cases for open bug issues
  • Write patches for open bug/feature issues, preferably with test cases included
  • Contribute to the documentation

There are a few guidelines that we need contributors to follow so that we have a chance of keeping on top of things.

If you want to making changes Better avoid working directly on the master branch, to avoid conflicts if you pull in updates from origin, so, if make your contribution under the branch dev, into folder src/.

##Community

  • Implementation help may be found at Stack Overflow (tagged mdr-file).

##Creators

@AlfredoBarronC

Copyright and license

Code and documentation (c) Copyright 2015 Modulr. Code published under license MIT