我订阅了从 NgRx 减速器获取提供程序的订阅。takeUntil()当最终返回一个包含内容的数组时,我想使用它来自动关闭订阅:
// Fetch providers
this.store.pipe(select(reducer.getProviders))
// .takeUntil(reducer.getProviders.length > 0)
.subscribe(providers => {
if (providers) {
this.providers = providers;
// takeUntil(/** something **/);
}
});
Run Code Online (Sandbox Code Playgroud)
有人可以帮我弄这个吗?
我不知道如何利用 takeUntil()
我正在使用Primefaces 3.3.1,并在<p:selectOneMenu>其中选择一个新值。选择新值时,将在处理值的地方调用valueChangeListener方法。像这样:
<h:form>
<p:selectOneMenu id="signature-menu" value="#{objectBuffertBean.loggedInSignature}" effect="fold" style="width: 125px;">
<p:ajax event="change" update="signature-menu"
listener="#{loginBean.changeSignature()}" />
<f:selectItems value="#{signaturesBean.signatures}" />
</p:selectOneMenu>
</h:form>
Run Code Online (Sandbox Code Playgroud)
LoginBean.java:
public void changeSignature(ValueChangeEvent e) {
if (e.getNewValue() != null) {
try {
WebDB db = new WebDB();
SessionHandler.getInstance().
getCurrentObjectBuffert().setSignature(
db.getSignatureBySignatureFromWebDb(
(String) e.getNewValue()
));
} catch (DatabaseException e1) {
e1.printStackTrace();
}
}
}
Run Code Online (Sandbox Code Playgroud)
但是,奇怪的是,当我选择一个新值时,会出现以下异常:
javax.el.MethodNotFoundException: Method changeSignature not found
Run Code Online (Sandbox Code Playgroud)
而且有效!该方法被以某种方式调用,并且正在处理新值!有谁有同样的奇怪并发症吗?
我一直在研究我的页面功能,易用性是我一直瞄准的一件事.为了改善我的布局,我决定创建可折叠的部分.但是,我有两个问题.1)我可以设置DIV扩展,但不能再缩小.所以我决定创建一些东西,告诉它是否大于最小尺寸,扩展内容,但现在它也不会扩展.这是我的代码:
$(".contentBox").click(function(){
var boxHeight = $(this).height();
var minBoxHeight = 40;
if (boxHeight < minBoxHeight)(function() {
$(this).css({
height: 'auto',
transition: 'height 800ms, background 800ms, box-shadow 800ms'
});
)};
});
Run Code Online (Sandbox Code Playgroud)
2)因为我正在使用自动高度,这是一种做事方式,所以当它展开和折叠时我会牺牲我的滑动动画.但是,如果有人知道一种方法来保持高度变化到内容大小,以及保持我想要的动画将是辉煌的.