-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Does not render upon AngularJS Updates #45
Comments
This sounds like it could have to do with the built in cross site scripting defence in angularjs. Look at how to sanitize html in angularjs. Basically you need to tag your html code as trusted for it to render as html and not text. |
So I tried that, making the DI changes and then the following in the controller
and partial |
Thats good to hear! I suspect this is due some timing issue. The "built-in" call to looks for elements to render is triggered on page load but in this case I am guessing the graph text is not there at that time which is why you need to trigger it by yourself. Can can run init several times without problems though so if it by chance would have rendered already the second init call will not break anything. Ok to close this one? |
Well the final solution I came up with (since running
I guess this is more of an issue with the angular approach than mermaid itself though, so you can close the issue, if you'd like |
I created a repository (https://github.com/kmader/angular-mermaid-js) showing how to integrate them properly with a demo |
That's great! I'm sure this will be helpful for many. /Knut Skickat från min iPad
|
I am trying to make a tool that builds up graphs using AngularJS
which is then rendered in
The problem is this does not render it just displays as text
graph TD; Img-->Neighbors; Img-->Filter;
is there a way to manually force mermaid to render again? Or perhaps a better way entirely for making the graphs?When run from the js console
mermaid.init();
will force the graph to render but afterwards it can't be updated anymore.The text was updated successfully, but these errors were encountered: