Last active
August 29, 2015 14:02
-
-
Save wildermuthn/19f4f129b39e8047c185 to your computer and use it in GitHub Desktop.
nodejs rendering of an object, injected straight into Angulart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// in app.js | |
app.get('/app/js/services/config.js', function(req, res) { | |
routes.getConfig(req, res, configs.angular); | |
}); | |
// in routes/index.js | |
exports.getConfig = function(req, res, angular){ | |
res.setHeader('Cache-Control', 'no-cache'); | |
res.render('config', { | |
clientShortName: angular.clientShortName, | |
logoPath: angular.logoPath, | |
clientShortName: angular.clientShortName, | |
logoPath: angular.logoPath, | |
firebaseRootUrl: angular.firebaseRootUrl, | |
restUrl: angular.restUrl, | |
photoLarge: angular.photoLarge, | |
photoThumb: angular.photoThumb, | |
baseFileUrl: angular.baseFileUrl, | |
filepickerKey: angular.filepickerKey, | |
baseEmailAddress: angular.baseEmailAddress, | |
subdomain: angular.subdomain, | |
}); | |
} | |
// in views/config.js | |
app.factory('Configs', function($q, $http, $location, $rootScope, $timeout) { | |
return { | |
clientShortName: '<%= clientShortName %>', | |
logoPath: '<%= logoPath %>', | |
firebaseRootUrl: '<%= firebaseRootUrl %>', | |
restUrl: '<%= restUrl %>', | |
photoLarge: '<%= photoLarge %>', | |
photoThumb: '<%= photoThumb %>', | |
baseFileUrl: '<%= baseFileUrl %>', | |
filepickerKey: '<%= filepickerKey %>', | |
baseEmailAddress: '<%= baseEmailAddress %>', | |
subdomain: '<%= subdomain %>', | |
isIphone: true, | |
}; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment