# Using AngularJS for Mautic plugin interface

**URL:** <https://forum.mautic.org/t/using-angularjs-for-mautic-plugin-interface/7635>\
**Category:** Product Support\
**Created:** [February 22, 2017, 3:41pm UTC](https://forum.mautic.org/t/using-angularjs-for-mautic-plugin-interface/7635 "2017-02-22T15:41:06Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![diggonomics](https://avatars.discourse-cdn.com/v4/letter/d/c4cdca/32.png) [@diggonomics](https://forum.mautic.org/u/diggonomics)\
**Post date:** [February 22, 2017, 3:41pm UTC](https://forum.mautic.org/t/using-angularjs-for-mautic-plugin-interface/7635/1 "2017-02-22T15:41:06Z")

</div>

Okay, I have a plugin question for something we are building inside Mautic:  
  
  
  
The front end builder is done in angularjs. You can only load angular once on a page, or nothing gets loaded. However Mautic changes the view with ajax and it doesn’t actually change the page so angular tries to load every time a different view is requested. Any idea how to only load it once? We tried multiple things such as to check if it’s loaded in a script tag and do document.write if not, but that seems to break mautic. Also tried checking if the request is ajax with $app-\>getRequest() but that runs in php and it executes first so it doesn’t help.  
  
Any ideas?

---

<div class="post-metadata">

**Author:** ![diggonomics](https://avatars.discourse-cdn.com/v4/letter/d/c4cdca/32.png) [@diggonomics](https://forum.mautic.org/u/diggonomics)\
**Post date:** [February 22, 2017, 3:41pm UTC](https://forum.mautic.org/t/using-angularjs-for-mautic-plugin-interface/7635/2 "2017-02-22T15:41:06Z")

</div>

Okay, I have a plugin question for something we are building inside Mautic:

The front end builder is done in angularjs. You can only load angular once on a page, or nothing gets loaded. However Mautic changes the view with ajax and it doesn’t actually change the page so angular tries to load every time a different view is requested. Any idea how to only load it once? We tried multiple things such as to check if it’s loaded in a script tag and do document.write if not, but that seems to break mautic. Also tried checking if the request is ajax with $app-\>getRequest() but that runs in php and it executes first so it doesn’t help.  
Any ideas?
