From 8a9d992df92b72894606a5a27a2ebecc844cbd1d Mon Sep 17 00:00:00 2001 From: Victor Pegado Date: Sun, 2 Nov 2014 15:01:40 +0100 Subject: [PATCH] update README and module structure --- .gitignore | 1 + README.md | 53 +++++++++++++++------------- file.js => angular-file-directive.js | 2 +- bower.json | 9 +++-- example/app.js | 4 +++ example/index.html | 27 ++++++++++++++ 6 files changed, 67 insertions(+), 29 deletions(-) create mode 100644 .gitignore rename file.js => angular-file-directive.js (98%) create mode 100644 example/app.js create mode 100644 example/index.html diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..fbe05fc --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +bower_components/ diff --git a/README.md b/README.md index 3efdbd6..46d214f 100644 --- a/README.md +++ b/README.md @@ -4,33 +4,36 @@ angular-file-directive File parsing directive for AngularJS ## Installation -Install with [Bower](http://bower.io/): - - $ bower install angular-file-directive - -Include from a [RawGit](https://rawgit.com/)'s CDN: - - -Or [download](https://github.com/vpegado/angular-file-directive/archive/master.zip) manually. +Install with [Bower](http://bower.io/): +```bash +$ bower install angular-file-directiv +``` ## Usage -`app.js` - - angular.module('myApp', ['file']); - - -`view.html` - - - - -
-

{{ file.name }}

- {{ file.name }} +``` + +Import it to the angular applicaiton: +```javascript +angular.module('myApp', ['ngFile']); +``` + +Use it in the view: +```html + + + + +
+

{{ file.name }}

+ {{ file.name }} -
+
+``` \ No newline at end of file diff --git a/file.js b/angular-file-directive.js similarity index 98% rename from file.js rename to angular-file-directive.js index 68d4f35..148428e 100644 --- a/file.js +++ b/angular-file-directive.js @@ -1,6 +1,6 @@ 'use strict'; -angular.module('file', []) +angular.module('ngFile', []) .directive('file', [function () { return { scope: { diff --git a/bower.json b/bower.json index 88aaabb..70ef51b 100644 --- a/bower.json +++ b/bower.json @@ -1,12 +1,15 @@ { "name": "angular-file-directive", - "version": "1.2.0", + "version": "1.3.0", "homepage": "https://github.com/vpegado/angular-file-directive", "authors": [ "Victor Pegado " ], "description": "Angular directive for parsing files", - "main": "file.js", + "main": "angular-file-directive.js", + "ignore": [ + "example/*" + ], "keywords": [ "angular", "file", @@ -15,6 +18,6 @@ ], "license": "MIT", "dependencies": { - "angular": ">=1.2.*" + "angular": "1.2.*" } } diff --git a/example/app.js b/example/app.js new file mode 100644 index 0000000..c907b9e --- /dev/null +++ b/example/app.js @@ -0,0 +1,4 @@ +angular.module('fileApp', ['ngFile']) + .controller('FileCtrl', ['$scope', function($scope){ + // Example controller + }]); diff --git a/example/index.html b/example/index.html new file mode 100644 index 0000000..9f00064 --- /dev/null +++ b/example/index.html @@ -0,0 +1,27 @@ + + + Example + + + + + +

Example

+ + + + + +
+

{{ file.name }}

+ {{ file.name }} +
{{ file | json }}
+
+ + + + \ No newline at end of file