Unable to find out whether the file exists or not based on the source provided.
See original GitHub issueUnable to find out whether the file exists or not based on the source provided in the <markdown-to-html>. If the file does not exist then throw an error event that can be captured in the usage component for some work.
<!-- loaded from remote url -->
<markdown [src]="'path/to/file.md'"></markdown>
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
What's the best way to check if a file exists in C? - Stack Overflow
Look up the access() function, found in unistd.h . You can replace your function with if (access(fname, F_OK) == 0) { // file...
Read more >Validate PowerShell to Check if a File Exists (Examples)
When using this cmdlet to test whether a file exists, the result is true or false. The result indicates whether the file exists...
Read more >How to check if file does not exist in Bash - nixCraft
Explains how to check if a file does not exist in Bash under Linux, macOS, *BSD and Unix-like systems using test command to...
Read more >How to Check if a File or Directory Exists in Bash - Linuxize
The first one will check whether a file exists regardless of the type, while the second one will return true only if the...
Read more >When (or why) should you check for a file's existence before ...
Check the file it's there, still source it if it's empty. Still fatal error if it can't be opened (even though it's there,...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi @ganeshkbhat,
If you use
MarkdownService.getSrc(src: string)
you will get an error if the source does not exist (see here).Correct me if I am wrong, but you would like a
error
ouput event on the component/directive as well?I added the
error
output event property, update to v1.5.1 to get it.Sure if you want to add me in your credits section i’ll be glad, your project look promising!