选择并映射可观察对象内的值

时间:2018-02-19 03:18:46

标签: angular rxjs observable angular2-observables

我正在尝试选择并映射可观察的无订阅的值?

问题:

有哪些运营商可以选择blocks并映射this.doggos.getDoggos().subscribe((doggos) => { this.galleryItems = doggos['documents'].map(d => d.blocks); }); 而无需破坏Observable?

从:

this.galleryItemsObs  = this.doggos.getDoggos().pipe(...);

为:

UIViewController

1 个答案:

答案 0 :(得分:3)

使用$(document).ready(function() { $(".dropdowntitle").click(function(i) { var thisEle = $(this).parent().find(".dropdowncontent"); var oriVisible = false; if (thisEle.is(":visible")) { oriVisible = true; } // Reset $(".dropdowncontent").hide(); $(".fa-chevron-down").show(); $(".fa-chevron-up").hide(); if (oriVisible) { // do nothing } else { thisEle.show(); $(this).find(".fa-chevron-down").hide(); $(this).find(".fa-chevron-up").show(); } }); });

.clear { display:block; }
.filter { position:relative; width:100%; display:inline-block; clear:both; }
.dropdowntitle { position:relative; width:100%; display:inline-block; clear:both; }
h1 { padding:0; margin:0; float:left; }
i.fa {float:left;}