External files being downloaded again when a cached view is accessed


#1

I’ve created a directive that renders a SVG through the <embed> tag and receive some variables from a controller. The idea is to set the fill color of the many paths in the SVG with the UI controls I’ve designed. It works perfectly!

The problem happens when I go to the next screen and go back to the screen using that directive. Observing the dev tools I realized all the SVGs are being downloaded again. The colors in the controls I’ve designed are there but the SVGs gets downloaded in their original aspect, as my colors didn’t change the watch I’ve registered are not being triggered and if I want to see those SVGs in the selected colors again I have to click in my designed controls and select them again so it triggers the directive which manipulates the aspect of the SVG.

Does anyone have an idea on how to solve that?

I’ve recorded a screencast demonstrating what I’ve described above :smile: