Skip to content

Commit

Permalink
add an AnnounceConfig client service, it can read announce config dat…
Browse files Browse the repository at this point in the history
…a of server side
  • Loading branch information
taobataoma committed Mar 27, 2017
1 parent ffff1df commit 2989274
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
3 changes: 2 additions & 1 deletion modules/core/server/controllers/core.server.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ exports.renderIndex = function (req, res) {

res.render('modules/core/server/views/index', {
user: JSON.stringify(safeUserObject),
sharedConfig: JSON.stringify(config.shared)
sharedConfig: JSON.stringify(config.shared),
announce: JSON.stringify(config.announce)
});
};

Expand Down
1 change: 1 addition & 0 deletions modules/core/server/views/layout.server.view.html
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
<script type="text/javascript">
var user = {{{ user }}};
var env = "{{ env }}";
var announce = {{{ announce }}};
</script>

<!--Load The Socket.io File-->
Expand Down
19 changes: 19 additions & 0 deletions modules/torrents/client/services/announce.client.service.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
(function () {
'use strict';

// Authentication service for user variables

angular
.module('torrents.services')
.factory('AnnounceConfig', AnnounceConfig);

AnnounceConfig.$inject = ['$window'];

function AnnounceConfig($window) {
var config = {
announce: $window.announce
};

return config;
}
}());

0 comments on commit 2989274

Please sign in to comment.