{"_id":"55fd9c6e56d6990d00a6caa4","project":"54d64e6b276f8e0d00feab95","__v":0,"user":"54d64e31276f8e0d00feab94","version":{"_id":"55fd9c6d56d6990d00a6ca9d","project":"54d64e6b276f8e0d00feab95","__v":1,"createdAt":"2015-09-19T17:33:33.368Z","releaseDate":"2015-09-19T17:33:33.368Z","categories":["55fd9c6e56d6990d00a6ca9e","55fd9c6e56d6990d00a6ca9f","55fd9c6e56d6990d00a6caa0"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.4.0","version":"1.4.0"},"category":{"_id":"55fd9c6e56d6990d00a6caa0","version":"55fd9c6d56d6990d00a6ca9d","__v":1,"project":"54d64e6b276f8e0d00feab95","pages":["55fd9c6e56d6990d00a6caa1","55fd9c6e56d6990d00a6caa2","55fd9c6e56d6990d00a6caa3","55fd9c6e56d6990d00a6caa4","55fd9c6e56d6990d00a6caa5","55fd9c6e56d6990d00a6caa6","55fd9c6e56d6990d00a6caa7","55fd9c6e56d6990d00a6caa8"],"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-02-07T18:14:40.771Z","from_sync":false,"order":2,"slug":"your-application","title":"Your Application"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-02-07T17:55:02.002Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"auth":"required","params":[],"url":""},"isReference":false,"order":2,"body":"By default angular-kick comes with two environments: development and production. Check the `environments.json` file in the root of your application to see constant injected to your application.\n\nYou can write `:::at:::@CONSTANT` in any js file in your application and gulp will automatically replace it from the environments.json file when you run kick server or kick build.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"angular.module('yourApp')\\n\\t.constant('VERSION', '@@VERSION');\",\n      \"language\": \"javascript\"\n    }\n  ]\n}\n[/block]\nYou can specify an environment when running local server, build and test tasks:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"$ kick server --production\\n$ kick test --test\\n$ kick build --development\",\n      \"language\": \"shell\"\n    }\n  ]\n}\n[/block]\nConstants defined in environments.json are usable not only in angular files. For example you can define different Google Analytics tracking IDs for development and production and replace them in app.html file itself. Or maybe you want different colors for development and production:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"<!-- Google Analytics -->\\n<script>\\n  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){\\n    (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),\\n      m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)\\n  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');\\n\\n  ga('create', '@@GOOGLE_ANALYTICS_KEY', 'auto');\\n</script>\",\n      \"language\": \"html\",\n      \"name\": \"app.html\"\n    },\n    {\n      \"code\": \".ribbon {\\n  color: @@RIBBON_COLOR;\\n}\",\n      \"language\": \"css\",\n      \"name\": \"main.css\"\n    }\n  ]\n}\n[/block]","excerpt":"","slug":"environments","type":"basic","title":"Environments"}
By default angular-kick comes with two environments: development and production. Check the `environments.json` file in the root of your application to see constant injected to your application. You can write `@@CONSTANT` in any js file in your application and gulp will automatically replace it from the environments.json file when you run kick server or kick build. [block:code] { "codes": [ { "code": "angular.module('yourApp')\n\t.constant('VERSION', '@@VERSION');", "language": "javascript" } ] } [/block] You can specify an environment when running local server, build and test tasks: [block:code] { "codes": [ { "code": "$ kick server --production\n$ kick test --test\n$ kick build --development", "language": "shell" } ] } [/block] Constants defined in environments.json are usable not only in angular files. For example you can define different Google Analytics tracking IDs for development and production and replace them in app.html file itself. Or maybe you want different colors for development and production: [block:code] { "codes": [ { "code": "<!-- Google Analytics -->\n<script>\n (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){\n (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),\n m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)\n })(window,document,'script','//www.google-analytics.com/analytics.js','ga');\n\n ga('create', '@@GOOGLE_ANALYTICS_KEY', 'auto');\n</script>", "language": "html", "name": "app.html" }, { "code": ".ribbon {\n color: @@RIBBON_COLOR;\n}", "language": "css", "name": "main.css" } ] } [/block]