I am working on one very complex functionality in SharePoint 2013 where I need to include angular code as a webpart in pages.
There are several scenarios like,
Masterpage (Shared Layout for header and footer and rest of the stuff) may already contain angularJS file (that can be older version as well).
When we add a web part with angular code in it, I also include angular script reference in it since we never know if master page / shared layout has angular reference or not.
What I tried to reproduce similar situation -
-Included Angular script twice.. First one is older Angular, second is latest one. Code fails to work with following error -
WARNING: Tried to load angular more than once.
Uncaught TypeError: undefined is not a functionangular.js:26130 (anonymous function)
What I want to achieve -
I want to check if master page already has reference to Angular, even if it has, ignore it and prefer the reference I have given because my code will be modular and dependent on the script I want to include (latest one, most probably)
I know this sounds stupid but this is how it works with SharePoint Web parts.. I am sure there will be some way like noConflict
in Angular..