Angualr Scripts Missing in Preview Mode
We have a Sitefinity deployment that heavily uses Angular, and we noticed that in Preview mode on a page none of the Angular works and Angular scripts aren't even loaded. Is this by default or do we have a misconfiguration somewhere? If it's the latter, is there a generic place I would go to find that?
So I figured this out, for anyone else who may happen to have the same problem. Inside our MVC/Views/Layouts folder our template has a line of code that excludes the Angular scripts if SystemManager.IsDesignMode is true.
I tried putting a seperate call in for SystemManager.IsPreviewMode - but Sitefinity doesn't differentiate the two at the same level. So having something like this did not work:
if (SystemManager.IsDesignMode)
//show specific code for design mode
else if (SystemManager.IsPreviewMode)
//show specific code for preview mode
However, I was able to work around it by embedding an if/else for preview mode INSIDE the DesignMode it - so like this:
if (SystemManager.IsDesignMode)
if (SystemManager.IsPreviewMode)
//show specific code for preview mode
else
//show specific code for design mode