requirejs - AngularJs and global namespace -


i'm working on project requires embed our angularjs application other websites. application uses requirejs load angularjs. however, current angularjs attach angular object window , can potentially cause conflict other websites using own version of angularjs. wonder if there's away can manually place these angular object specific namespace without breaking code.

you may try renaming following in source:

http://ajax.googleapis.com/ajax/libs/angularjs/1.0.6/angular.js

   /** @name angular */     angular           = window.angular || (window.angular = {}), 

to custom:

   /** @name angular */     angular           = window.angularx || (window.angularx = {}), 

and use renamed version in code: angularx.


Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -