angular-media-preview
Advanced tools
Comparing version 0.1.0 to 0.1.1
{ | ||
"name": "angular-media-preview", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": "Don't let your users upload the wrong media!", | ||
@@ -5,0 +5,0 @@ "main": "Gruntfile.js", |
@@ -22,3 +22,3 @@ # angular-media-preview | ||
``` | ||
and you are ready to go. | ||
and you are ready to use the new directive. | ||
@@ -32,3 +32,7 @@ --- | ||
```html | ||
<input type="file" ng-model="myUpload" media-preview> | ||
<!-- without ng-model --> | ||
<media-preview></media-preview> | ||
<!-- with ng-model --> | ||
<media-preview model="myModel"></media-preview> | ||
``` | ||
@@ -42,13 +46,12 @@ | ||
#### Passing element ID | ||
#### Passing element ID: | ||
```html | ||
<input type="file" ng-model="myUpload" preview-container="myContainer" media-preview> | ||
<media-preview preview-class="img-thumbnail" preview-container="mediaHere" multiple></media-preview> | ||
<div id="myContainer"></div> | ||
``` | ||
#### Passing a $scope HTML element | ||
#### Passing a $scope HTML element: | ||
If you want to pass a element from the $scope: | ||
If you want you can pass a HTML Element created in the $scope: | ||
@@ -63,3 +66,3 @@ ```javascript | ||
```html | ||
<input type="file" ng-model="myUpload" preview-container="theContainer" media-preview> | ||
<media-preview ng-model="myUpload" preview-container="theContainer"></media-preview> | ||
``` | ||
@@ -77,12 +80,7 @@ | ||
* __preview-class__: the class to be added to the preview element | ||
* __multiple__: specify when the input should accept multiple files | ||
```html | ||
<input type="file" ng-model="myFile" preview-class="my-preview" media-preview> | ||
``` | ||
--- | ||
__IMPORTANT: be sure to have a model bind to your input (attribute ng-model), otherwise the directive will not work!__ | ||
__The directive takes care to update your model value on change, so you don't have to write your own one.__ | ||
See the issue: [#1375](https://github.com/angular/angular.js/issues/1375) |
24440
82