if I host an angular app at some custom location e.g. http://localhost/collosys
then i have to change all the ng-include to have \"/collosys/\" for all the address
You have several options as previously mentioned:
Change angular source code (also known as monkey patching) - not recommended, requires high maintenance and makes your code unreadable for other people.
Use a decorator, which allows you to get the ngInclude directive and change it. Decorators are often used to extend\change 3rd party libs, but the downside is that you'll have to replace the entire compile function of ngInclude, which is about 60 lines in exchange for a little prefix. Not to mention that if angular changes how ngInclude works, you'll be using a depracated or broken version of it.
Write your own wrapping directive, which will call ngInclude. from now on you'll have myInclude:
angular.module('myApp').directive('myInclude', [function () {
var baseUrl = 'collosys';
return {
replace: true,
scope: {
myInclude: '@'
},
template: ''
};
}]);