question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to find out whether the file exists or not based on the source provided.

See original GitHub issue

Unable 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:closed
  • Created 6 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
jfcerecommented, Feb 20, 2018

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?

<!-- loaded from remote url -->
<markdown [src]="'path/to/file.md'" (error)="onError($event)"></markdown>
0reactions
jfcerecommented, Feb 22, 2018

I added the error output event property, update to v1.5.1 to get it.

<markdown [src]="'path/to/file.md'" (error)="onError($event)"></markdown>

Sure if you want to add me in your credits section i’ll be glad, your project look promising!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found