This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <md-progress-bar mode="indeterminate" color="accent" *ngIf="isDisplay" style="position:fixed"></md-progress-bar> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { Component, OnInit } from '@angular/core'; | |
| import { Observable } from 'rxjs/Observable'; | |
| import { ProgressBarService } from './progressbar.service'; | |
| @Component({ | |
| selector: 'app-progressbar', | |
| templateUrl: './progressbar.component.html', | |
| styleUrls: ['./progressbar.component.scss'], | |
| providers:[] | |
| }) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <div *ngFor="let result of results | async"> | |
| <p>{{result}}</p> | |
| </div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export class FormControlComponent { | |
| myControl = new FormControl(); | |
| results: Observable<any[]>; | |
| constructor(public http: Http) { | |
| this.results = this.myControl.valueChanges | |
| .startWith('someValue') | |
| .map(text => new formatQuery(text)) // generate a url | |
| .switchMap(url => this.http.get(url), (_, res)=> res.json()); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <input [formControl]="myControl"/> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| myControl = new FormControl(); | |
| constructor() { | |
| this.myControl.valueChanges | |
| .map(text => console.log(text)) | |
| .subscribe(); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { Component, OnInit } from '@angular/core'; | |
| import { Http } from '@angular/http'; | |
| import { Observable } from 'rxjs/Observable'; | |
| import { ExampleService } from './example.service' | |
| import 'rxjs/Rx'; | |
| import 'rxjs/add/observable/forkJoin'; | |
| import 'rxjs/add/operator/mergeMap'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { Http } from '@angular/http'; | |
| import { Injectable } from '@angular/core'; | |
| @Injectable () | |
| export class ExampleService { | |
| constructor(public http: Http) {} | |
| getDataA() { | |
| return this.http.get('http://www.server.com/dataA').map(res => res.json()); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { Component, OnInit } from '@angular/core'; | |
| import { Http } from '@angular/http'; | |
| import { Observable } from 'rxjs/Observable'; | |
| import 'rxjs/Rx'; | |
| import 'rxjs/add/operator/mergeMap'; | |
| @Component({ | |
| selector: 'example-flatMap', | |
| templateUrl: 'flat-map.component.html' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { Component, OnInit } from '@angular/core'; | |
| import { Http } from '@angular/http'; | |
| import { Observable } from 'rxjs/Observable'; | |
| import 'rxjs/Rx'; | |
| import 'rxjs/add/observable/forkJoin'; | |
| @Component({ | |
| selector: 'example-fork-join', | |
| templateUrl: 'fork-join.component.html' |
NewerOlder