The main thing you need to look at is the $locationservice , in particular the method $location.host(). This will return you the full domain, from there it is easy to get a subdomain and use it.
, , .
- :
app.factory('subdomain', ['$location', function ($location) {
var host = $location.host();
if (host.indexOf('.') < 0)
return null;
else
return host.split('.')[0];
}]);
, ..
app.controller('SomeCtrl', ['$scope', 'subdomain', function ($scope, subdomain) {
}]);