Skip to content

Instantly share code, notes, and snippets.

@ferentchak
Created January 22, 2013 19:10
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ferentchak/4597415 to your computer and use it in GitHub Desktop.
Save ferentchak/4597415 to your computer and use it in GitHub Desktop.
Shows my current idea for dynamically changing the location for my services
<!doctype html>
<html lang="en" ng-app="NinjaPantsLazer">
<head>
<meta charset="utf-8">
</head>
<body>
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.0.2/angular.min.js"></script>
<script src="compiled/MadeOnMyServer.js">
//This script file is created dynamicly on your server yourSpecificUrl
//can be populated from an enviroment varible on your server
angular.module("EnvironmentSpecificModule", [])
.value("baseUrl", "http://yourSpecificUrl.com")
.factory("BaseURLResolver", ["baseUrl", function(baseUrl) {
return function(relativeUrl) {
return baseUrl + relativeUrl;
};
}]);
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment