1

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.