1 source, Three subscribers
Subscriber 1 subscribes and source starts emitting
Subscriber 2 subscribes halfway
Subscriber 3 subscribes after source has completed.
import Rx from 'rxjs/Rx';
var data = [];
| /********************* | |
| ** I Dream in Code ** | |
| *********************/ | |
| while( I .sleep() ) { | |
| I.dream() in code; | |
| I.dream() in algorithms; | |
| I.dream() in subroutines; | |
| Rewind.age(5) && I.dream.of(["missing pants", "driving hotwheels", "peeing in fountains"]) ); //hint: it’s my bed |
| // Requires JQuery and CORS enabled for the Origin you're testing from. | |
| // Uncomment the next 4 lines to import JQuery | |
| // var script= document.createElement('script'); | |
| // script.type= 'text/javascript'; | |
| // script.src= '//cdnjs.cloudflare.com/ajax/libs/jquery/2.0.0/jquery.min.js'; | |
| // document.head.appendChild(script); | |
| // Set up the multipart form using HTML5 FormData object | |
| // https://developer.mozilla.org/en-US/docs/DOM/XMLHttpRequest/FormData | |
| var form = new FormData(); |
1 source, Three subscribers
Subscriber 1 subscribes and source starts emitting
Subscriber 2 subscribes halfway
Subscriber 3 subscribes after source has completed.
import Rx from 'rxjs/Rx';
var data = [];
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'.