Prism: Prism with AngularJS and UI-Router

Created on 11 Nov 2015  路  2Comments  路  Source: PrismJS/prism

Not too sure this is a bug or not, probably not.

I'm using ui-router ("AngularUI Router is a routing framework for AngularJS, which allows you to organize the parts of your interface into a state machine..blah, blah")

Here's the issue:

Prism works on my main index.html (it's loaded and highlights and displays color, it's amazing, love it!), but when I change state it no longer highlights code in that state correctly, which isn't to say it doesn't see Prism anymore, but the code blocks are colorless. Very odd.

and! anything in my state changes includes the correctly highlighted code in index, but any code within that new state isn't rendered properly.

I will try to add some images later this afternoon to help anyone better understand the issue, but does it make sense?

Most helpful comment

That did it! Thanks so much!

All 2 comments

Hi! Could you provide an online example reproducing the issue please?
I guess the router loads your changes dynamically. You might have to trigger the highlighting yourself by calling Prism.highlightAll() once they are added into the DOM.

That did it! Thanks so much!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jiantosca picture jiantosca  路  4Comments

kizu picture kizu  路  7Comments

RunDevelopment picture RunDevelopment  路  5Comments

donnieflorence picture donnieflorence  路  4Comments

jaune162 picture jaune162  路  6Comments