combineLatest(money$,currency$).subscribe(data = > /*тут работа с массивов, где data[0] - это последние пришедшие данные от money$ и data[1] - последние от currency$*/)
или
combineLatest(money$,currency$).subscribe(([money, currency]) = > /*...ваша логика*/)
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<base href="/">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.1.0/css/all.css"
integrity="sha384-lKuwvrZot6UHsBSfcMvOkWwlCMgc0TaWr+30HWe3a4ltaBwTZhyTEggF5tJv8tbt"
crossorigin="anonymous">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css"
integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm"
crossorigin="anonymous">
</head>
<body>
<app-strategies-start></app-strategies-start>
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js"
integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN"
crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js"
integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q"
crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"
integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl"
crossorigin="anonymous"></script>
</body>
</html>
this.stateService.fetch(this.reports_id).subscribe((data: State[]) => {
console.log(data)
stateConfig.data = data.map(item => item.state_time)
stateConfig.labels = data.map(item => item.density)
const stateCtx = this.stateRef.nativeElement.getContext('2d')
stateCtx.canvas.height = '300px'
new Chart(stateCtx, createChartConfig(stateConfig))
}
)
ngOnInit() {
const stateConfig: any = {
label: 'Статистика',
color: 'rgb(255, 99, 132)'
}
this.chart = {};
this.stateService.fetch(this.reports_id).subscribe((data: State[]) => {
console.log(data)
stateConfig.data = data.map(item => item.state_time)
stateConfig.labels = data.map(item => item.density)
const stateCtx = this.stateRef.nativeElement.getContext('2d')
stateCtx.canvas.height = '300px'
this.chart = new Chart(stateCtx, createChartConfig(stateConfig))
}
)}
<canvas #state>{{ chart }}</canvas>
ngOnDestroy(): void {
console.log('destroyed')
}
getPeople().subscribe(data => console.log(data))
[
{
"general": [
{
"firstName": "Liana",
"lastName": "Crooks",
"avatar": "https://s3.amazonaws.com/uifaces/faces/twitter/kevinoh/128.jpg"
}
],
"job": [
{
"company": "Ledner, Johnson and Predovic",
"title": "Investor Functionality Coordinator"
}
],
"contact": [
{
"email": "Gerry_Hackett77@gmail.com",
"phone": "(895) 984-0132"
}
],
"address": [
{
"street": "1520 Zemlak Cove",
"city": "New Devon",
"zipCode": "42586-7898",
"country": "Guinea-Bissau"
}
]
},
{
"general": [
{
"firstName": "Deontae",
"lastName": "Dare",
"avatar": "https://s3.amazonaws.com/uifaces/faces/twitter/andysolomon/128.jpg"
}
],
"job": [
{
"company": "D'Amore, Dicki and Borer",
"title": "International Applications Consultant"
}
],
"contact": [
{
"email": "Kellie.Marvin38@yahoo.com",
"phone": "1-615-843-3426 x600"
}
],
"address": [
{
"street": "65901 Glover Terrace",
"city": "Alden ton",
"zipCode": "57744-4248",
"country": "Kenya"
}
]
}
]
{
"a": {
"general": [
{
"firstName": "Liana",
"lastName": "Crooks",
"avatar": "https://s3.amazonaws.com/uifaces/faces/twitter/kevinoh/128.jpg"
}
],
"job": [
{
"company": "Ledner, Johnson and Predovic",
"title": "Investor Functionality Coordinator"
}
],
"contact": [
{
"email": "Gerry_Hackett77@gmail.com",
"phone": "(895) 984-0132"
}
],
"address": [
{
"street": "1520 Zemlak Cove",
"city": "New Devon",
"zipCode": "42586-7898",
"country": "Guinea-Bissau"
}
]
},
"b": {
"general": [
{
"firstName": "Deontae",
"lastName": "Dare",
"avatar": "https://s3.amazonaws.com/uifaces/faces/twitter/andysolomon/128.jpg"
}
],
"job": [
{
"company": "D'Amore, Dicki and Borer",
"title": "International Applications Consultant"
}
],
"contact": [
{
"email": "Kellie.Marvin38@yahoo.com",
"phone": "1-615-843-3426 x600"
}
],
"address": [
{
"street": "65901 Glover Terrace",
"city": "Alden ton",
"zipCode": "57744-4248",
"country": "Kenya"
}
]
}
}
{
"data": [
{
"general": {
"firstName": "Liana",
"lastName": "Crooks",
"avatar": "https://s3.amazonaws.com/uifaces/faces/twitter/kevinoh/128.jpg"
},
"job": {
"company": "Ledner, Johnson and Predovic",
"title": "Investor Functionality Coordinator"
},
"contact": {
"email": "Gerry_Hackett77@gmail.com",
"phone": "(895) 984-0132"
},
"address": {
"street": "1520 Zemlak Cove",
"city": "New Devon",
"zipCode": "42586-7898",
"country": "Guinea-Bissau"
}
},
{
"general": {
"firstName": "Deontae",
"lastName": "Dare",
"avatar": "https://s3.amazonaws.com/uifaces/faces/twitter/andysolomon/128.jpg"
},
"job": {
"company": "D'Amore, Dicki and Borer",
"title": "International Applications Consultant"
},
"contact": {
"email": "Kellie.Marvin38@yahoo.com",
"phone": "1-615-843-3426 x600"
},
"address": {
"street": "65901 Glover Terrace",
"city": "Alden ton",
"zipCode": "57744-4248",
"country": "Kenya"
}
}
]
}
this.monitoringsService.getFilteredMonitorings().subscribe(rows =>
this.filteredMonitorings = rows
.filter(monitoring => monitoring.spr_prioritys_id)
.filter(monitoring => monitoring.n_users_id)
.filter(monitoring => monitoring.priority_itog));
*ngIf="(monitoring.spr_prioritys_id) != null && (monitoring.n_users_id) && (monitoring.priority_itog) "
<button type="button" class="btn btn-sm btn-outline-success" (click)="openVerticallyCentered(content)">Create new</button>
<ng-template let-c="close" let-d="dismiss" #content>
<app-create-single-form [book]="activeBook" [user]="activeUser" [c]="c" [d]="d"></app-create-single-form>
</ng-template>
openVerticallyCentered(content): void {
this.modalService.open(content, {centered: true, size: 'lg'});
}