git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git
cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
In this demonstration I will show you how to read data in Angular2 final release before application startup. You can use it to read configuration files like you do in other languages like Java, Python, Ruby, Php.
This is how the demonstration will load data:
a) It will read an env file named 'env.json'. This file indicates what is the current working environment. Options are: 'production' and 'development';
b) It will read a config JSON file based on what is found in env file. If env is "production", the file is 'config.production.json'. If env is "development", the file is 'config.development.json'.
// include this code in your application, you don't need to call any initialization manually! | |
Ember.Application.initializer({ | |
name: "meta", | |
initialize: function(container, application) { | |
// helper function to get tag from dom | |
var _getTag = function(tagname, property, value) { | |
var tags = document.head.getElementsByTagName(tagname), | |
tag, |