I think ... it is possible. lol !
You can declare global value via JSON file. (keep it on your server)
See the JSON format here.
Example:
globalvalue.json
[
{
"key": 404,
"message": "This request caon't be processed"
},
{
"key": 200,
"message": "your request is successfull"
}
]
And next you just read that global value via your server it store the JSON file.
Angular Code:
angular
.module('app.services', [])
.factory('Friend', function ($http) {
return {
get: function () {
return $http.get('/globalvalue.json');
}
};
});
Then use your factory this way:
.angular
.module('app.controllers', ['app.services'])
.controller('yourCtrl', function ($scope, Friend) {
Friend.get().then(function (msg) {
$scope.msg = msg;
});
});
Cr. Reading data from JSON file in Angularjs.
let's fun. :)