File preview directive in angularJs?

493 views Asked by At

I want to preview files in web browser based on file types. (Not in upload case)

Now I am using following method,

<img src="img/file_not.png" class="thumbnail" ng-if="!expense.attachment_url"/>
<a href="expenses/attachments/{{expense.id}}"><img src="uploads/expense/{{expense.attachment_url}}" class="thumbnail" ng-if="expense.attachment_url && isImage(expense.attachment_url)"/></a>
<a href="expenses/attachments/{{expense.id}}"><img src="img/download_file.png" ng-if="expense.attachment_url && !isImage(expense.attachment_url)"/></a>

Only image files show to user and will show icons in other cases.

is there any good library or directive for angularjs for implementing file preview.?

0

There are 0 answers