I am using angular to create page transitions in a wordpress site. My site loads a normal wordpress page which fires its PHP and populates the page with angular elements (the body). The angular elements then use animated transitions to change the body content with 3 separate html pages (so header and footer are unaffected.)
I have PHP in the separate html pages. I thought the PHP would trigger before each page came into view - but im guessing because the pages are being loaded by angular and not the browser, this doesn't happen?
<div id="pageone">
<p>This is page 1.</p>
<a href="#page2">Go to page 2 </a><br>
<?php echo ('this php does not work'); ?>
<p>This html is below php</p>
</div>
Although I use pages, the same concept applies to divs being brought into view. Is there anyway to fire PHP using angular after the initial page load? Is this possible at all?
See Question&Answers more detail:os