You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+24-6Lines changed: 24 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,6 @@
1
-
angular-file-saver
1
+
Angular File Saver
2
2
=========
3
+
3
4
Angular-file-saver is an AngularJS service that leverages
4
5
[FileSaver.js](https://github.com/eligrey/FileSaver.js/) and
5
6
[Blob.js](https://github.com/eligrey/Blob.js/) to implement the HTML5 W3C
@@ -11,15 +12,17 @@ saveAs() FileSaver interface in browsers that do not natively support it.
11
12
-[Blob.js](https://github.com/eligrey/Blob.js/)
12
13
13
14
## Installation
14
-
Using bower
15
+
Using bower:
15
16
```
16
17
$ bower install angular-file-saver
17
18
```
18
-
Using npm
19
+
Using npm:
19
20
```
20
21
$ npm install angular-file-saver
21
22
```
22
23
24
+
`dist/angular-file-saver.bundle.js` contains all required dependencies and grants access to both `Blob.js` and `FileSaver.js` polyfills via `Blob` and `SaveAs` services (include `ngFileSaver` module as a dependency first).
25
+
23
26
## Basic usage
24
27
- Include the `ngFileSaver` module to your project;
</code></pre><p><code>dist/angular-file-saver.bundle.js</code> contains all required dependencies and grants access to both <code>Blob.js</code> and <code>FileSaver.js</code> polyfills via <code>Blob</code> and <code>SaveAs</code> services (include <code>ngFileSaver</code> module as a dependency first).</p>
42
+
<h2id="basic-usage">Basic usage</h2>
43
+
<ul>
44
+
<li>Include the <code>ngFileSaver</code> module to your project;</li>
45
+
<li>Pass <code>FileSaver</code> service as a dependency;</li>
46
+
<li>Invoke <code>FileSaver.saveAs</code> and pass an object with the following set of options:<ul>
47
+
<li><code>data</code> - data, represented as an array or a <ahref="https://developer.mozilla.org/en/docs/Web/API/Blob">Blob object</a>;</li>
48
+
<li><code>filename</code>;</li>
49
+
<li><code>options</code> - a set of options for the <ahref="https://developer.mozilla.org/en/docs/Web/API/Blob">Blob constructor</a>(optional attribute);</li>
0 commit comments