Skip to content

Instantly share code, notes, and snippets.

View danseid's full-sized avatar
⌨️
coding

Daniel Seidler danseid

⌨️
coding
View GitHub Profile

Reading data before application startup in Angular 2

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'.

@danseid
danseid / H2Tasks.java
Last active August 29, 2015 14:22 — forked from jewelsea/H2Tasks.java
package h2app;
import javafx.application.Application;
import javafx.collections.*;
import javafx.concurrent.Task;
import javafx.scene.Scene;
import javafx.scene.control.*;
import javafx.scene.layout.*;
import javafx.stage.Stage;
@danseid
danseid / gist:4451655
Created January 4, 2013 10:58
jActor - Pi Calculation
import org.agilewiki.jactor.*;
import org.agilewiki.jactor.lpc.JLPCActor;
import org.agilewiki.jactor.lpc.Request;
import java.util.Random;
/**
* @author Daniel Seidler
* @since 2013/01/04
*/
@danseid
danseid / Knapsack.kt
Created November 29, 2012 10:01
Knapsack Solver
import java.util.ArrayList
/**
* @author Daniel Seidler
* @since 2012/11/29
*/
data class Item(val weight: Int, val value: Int)