我有一个名为“在_auth服务中进行身份验证”的主题。
如果某些条件失败,我想处置/取消订阅它,以便在下一个值到达经过身份验证的主题时不会调用此订阅。
this.sub = this._auth.authenticated
.subscribe((loggedIn) => {
if (!loggedIn) {
this.sub.dispose(); // doesn't work because this.sub is null
this._location.replaceState('/');
this._auth.doLogout(); // emits value again in authenticated subject
}
});
Run Code Online (Sandbox Code Playgroud)
rxjs-5 的做法是什么?
这是我用来进行查询的代码:
var scanParams = {
TableName : 'xxxx',
FilterExpression : '( (event = :e0) AND (event = :e1 AND eventTime > :et1 AND eventTime < :et2) )',
ExpressionAttributeValues: {
':e0': { S: 'ME 21' },
':e1': { S: 'ME 21' },
':et1': { N: 1509267218 },
':et2': { N: 1509353618 }
},
ProjectionExpression: "event, customer_id, visitor",
};
Run Code Online (Sandbox Code Playgroud)
在相应 dynamodb 表的配置中,我似乎为 eventTime 列添加了 Number。
这是错误:
error happened { MultipleValidationErrors: There were 2 validation errors:
* InvalidParameterType: Expected params.ExpressionAttributeValues[':et1'].N to be a …Run Code Online (Sandbox Code Playgroud) 在angular2模板中,如果我写:
[ngStyle]="{'background-color': 'red'}"
Run Code Online (Sandbox Code Playgroud)
它按预期工作.但如果我写:
[ngStyle]="{'background-color': 'red !important'}"
Run Code Online (Sandbox Code Playgroud)
它不工作(也没有显示任何错误)