nd

ng-download

angular's download module

Showing:

Popularity

Downloads/wk

325

GitHub Stars

1

Maintenance

Last Commit

4yrs ago

Contributors

1

Package

Dependencies

0

License

ISC

Type Definitions

Tree-Shakeable

No?

Categories

Readme

ng-download

angular's download module

Docs http://danml.com/download.html

Getting-Started

Import ng-download and angular.

import angular from 'angular';
import ngDownload from 'ng-download';

Ensure that your application module specifies ngDownload as a dependency:

angular.module(MODULE_NAME, ['ngDownload'])
    .controller(CONTROLLER_NAME, ['$downloadService', function($downloadService) {
        $downloadService.download(data, fileName, mineType);
    }]);

Or use 'download' directive:

<script>
    $scope.downloadConfig = {
      fileName: 'example',
      data: '',
      mimeType: 'application/zip'
    }
</script>
<button download download-config="downloadConfig">Download</button>

method: download Params

  • @param {string} The Blob, File, String, or dataURL containing the soon-to-ba File's contents.
  • @param {string} The name of the file to be created. Note that older browsers (like FF3.5, Ch5) don't honor the file name you provide, instead they automatically name the downloaded file.
  • @param {string} The MIME content-type of the file to download. While optional, it helps the browser present friendlier information about the download to the user, encouraging them to accept the download.

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100
No reviews found
Be the first to rate

Alternatives

No alternatives found

Tutorials

No tutorials found
Add a tutorial