I use grunt-ng-constant. It will write a file for the different
environment. It is not optimal and would like to find a better way,
but it works. At serve time it write the development version, and at
build time writes the prod version. For example:
ngconstant: {
options: {
space: ' ',
template: grunt.file.read('constant.tpl.ejs'),
//wrap: '"use strict";\n\n {%= __ngModule %}',
name: 'env'
},
// Environment targets
development: {
options: {
dest: '<%= yeoman.app %>/scripts/env.js'
},
constants: {
ENV: {
"baseHref": "/",
"name": "development",
"apiEndPoint": local.dev.apiEndPoint,
"cdnUrl": local.dev.cdn,
"appVersion": local.common.appVersion,
"cookieDomain": local.dev.cookieDomain
}
}
},
production: {
options: {
dest: '<%= yeoman.app %>/scripts/env.js'
},
constants: {
ENV: {
baseHref: '/',
name: 'production',
apiEndPoint: local.prod.apiEndPoint,
cdnUrl: local.prod.cdn,
appVersion: local.common.appVersion,
cookieDomain: local.prod.cookieDomain
}
}
}
},
On Mon, Jan 12, 2015 at 10:36 AM, Sander Elias <[email protected]> wrote:
> Al,
>
> I'm confused. You have to host your angular app somewhere don't you? it
> doesn't automatically appear in your client's does it? the simplest way is
> add an config.json with your app, and just read that for the configuration.
> one on the test server, and one on the deployment server will take care of
> what you need doesn't it?
>
> Regards
> Sander
>
> --
> You received this message because you are subscribed to the Google Groups
> "AngularJS" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/angular.
> For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.