我想获得拉伸到其父div的全宽度的标签.有人知道怎么做吗?
<div class="tabs-header">
<mat-tab-group>
<mat-tab label="Signup">Content 1</mat-tab>
<mat-tab label="Login">Content 2</mat-tab>
</mat-tab-group>
</div>
Run Code Online (Sandbox Code Playgroud)
截至目前,它看起来像这样:
我做了一些研究,看起来曾经是一种方法来做这件事,<md-stretch-tabs>但似乎不是一个功能,没有相关的文档.
我在 AWS 上使用步进函数。考虑由 lambda 组成的状态机:
"StartAt": "Metadata",
"States": {
"Metadata": {
"Type": "Task",
"Resource": "${metadataArn}",
"Next": "StoreMetadata",
"Retry" : [
{
"ErrorEquals": [ "States.All" ],
"IntervalSeconds": 2,
"MaxAttempts": 3
}
],
"Catch": [
{
"ErrorEquals": [ "States.All" ],
"Next": "ErrorHandler"
}
]
} ...
...
Run Code Online (Sandbox Code Playgroud)
如何将特定数据传递给“ErrorHandler”。比如失败的那一步,可能是一条数据。我正在使用 nodejs 但可以外推到任何运行时。
例如,在节点中,我们可能有一个 lambda,其中:
module.exports.handler = async input => {
const ids = JSON.parse(input).ids
// try to read in data for ids.
// read fails / throws exception
}
Run Code Online (Sandbox Code Playgroud)
我怎样才能让错误处理程序获取 id 数组,以便我可以将它们标记为失败?如果这个“ErrorHandler”是多个步骤的捕获,我怎么能知道哪些步骤失败了?
我有一个角度应用程序,它向Http服务发出请求,并在另一个Http服务上调用switchMap.由于某种原因,switchMap中的请求仅在第一次调用父调用时运行.否则父请求将触发,而switchMap不会触发,这里是代码:
this._receivableService.newTenantDebitCredit(tenantCredit)
.take(1)
.switchMap(result =>
// Refresh the lease receivables before giving result
this._receivableService.getAll({
refresh: true,
where: { leaseId: this.leaseId }
}).take(1).map(() => result)
)
.subscribe(
...
)
Run Code Online (Sandbox Code Playgroud)
每次在上面调用newTenantDebitCredit方法时,如何在switch map中运行getAll请求?
编辑:这是调用的函数的全部内容click.当我第一次单击按钮时,给定单元执行两种方法.如果我尝试已经调用该方法的单元(没有刷新),则只执行第一个方法.我意识到很多这可能并不清楚,这是一个相当大的项目.
public submitTenantCredit() {
this.isLoading = true;
let tenantCredit: NewTenantDebitCreditData;
let receivableDefinitions: ReceivableDefinition[] = [];
// construct receivable defintions for NewTenantDebitData model
receivableDefinitions = this._constructReceivableDefinitions();
// construct data we will be POSTing to server.
tenantCredit = new NewTenantDebitCreditData({
siteId: this._apiConfig.siteId,
leaseId: this.leaseId,
isCredit: true,
receivables: receivableDefinitions,
reason: this.actionReason …Run Code Online (Sandbox Code Playgroud) 使用dotnet cli v2.1.4我使用下载了Spa模板dotnet new --install Microsoft.DotNet.Web.Spa.ProjectTemplates::2.0.0。然后,我使用创建了一个有角度的项目dotnet new angular -o my-project。然后,我打开了Visual Studio for Mac,并打开了.csproj由cli为上述项目生成的文件。呈现了解决方案,但可悲的是,即使每个文件只有一个副本出现在查找程序中或ls在目录中使用,客户端文件也都被复制了。我发现服务器线程存在相关问题,建议卸载项目,等等。我尝试了这些解决方案,但遗憾的是问题仍然存在,请参见所附图片。服务器端文件不重复。
自动完成和智能感知对于 Visual Studio for Mac 来说非常糟糕。它实际上会自动完成字符串中间的随机对象,并且在尚无有效返回值的函数中间(在 for 或 let 语句中)时根本不起作用。我不得不把它关掉,因为它比无用更糟糕。有人知道如何解决这个问题或者我应该更改 IDE 吗?或者这是我自己独有的问题。作为参考,我在脚本文件中。
我正在遵循 Tomas Petricek 的关于 Multiplesight 的指南。我正在尝试创建一个 C# 单元测试项目来测试 F# 库中的一些方法,但是即使在 C# 项目中添加对 F# 项目的引用后,我也无法使用任何方法,因为它们无法识别,并且何时尝试使用 F# 项目中的命名空间,它是一个未知的命名空间。
大多数此类问题的解决方案似乎都针对不同的框架,但是,我在两个项目中都针对 4.5.2。
可能出什么问题了?
在 angular 中,我如何active在两条不同的路线上建立routerlink 。IE
<li routerLinkActive="active"><a routerLink="dashboard">Dashboard</a></li>
Run Code Online (Sandbox Code Playgroud)
active当“仪表板”是路线时将具有样式。有没有办法让相同的链接在不同的网址(例如“home”)上也处于活动状态?
我正在考虑使用标准库进行路由的方法.有一个处理函数是否有效,它将根据请求类型调用其他处理函数?例如
func main() {
m := http.NewServeMux()
m.HandleFunc("/books", books)
// ...
}
func books(w http.ResponseWriter, r *http.Request) {
switch r.Method {
case "GET":
getBooks(w, r)
case "POST":
createBook(w, r)
}
}
Run Code Online (Sandbox Code Playgroud)
这是好习惯吗?我不想声明自定义处理程序,因为我发现函数更清洁一些.
我正在使用sam这样定义一个dynamodb表:
#DynamoTables
DevicesTable:
Type: AWS::DynamoDB::Table
Properties:
TableName: devices
AttributeDefinitions:
-
AttributeName: "id"
AttributeType: "S"
-
AttributeName: "customerId"
AttributeType: "S"
KeySchema:
-
AttributeName: "id"
KeyType: "HASH"
-
AttributeName: "customerId"
KeyType: "RANGE"
GlobalSecondaryIndexes:
-
IndexName: "customers"
KeySchema:
-
AttributeName: "customerId"
KeyType: "HASH"
Projection:
ProjectionType: "ALL"
ProvisionedThroughput:
ReadCapacityUnits: "5"
WriteCapacityUnits: "5"
ProvisionedThroughput:
ReadCapacityUnits: "5"
WriteCapacityUnits: "5"
Run Code Online (Sandbox Code Playgroud)
我能够访问使用具有lambda函数表Properties: Policies: AmazonDynamoDBFullAccess的SAM和使用规定看跌PARAMS定义TableName: 'devices'中node。但是,当我尝试通过在索引上定义查询来查询索引时:
params = {
TableName: 'devices',
IndexName: 'customers'
// ...
}
Run Code Online (Sandbox Code Playgroud)
我收到一条错误消息,指出 lambda 函数无权访问该索引: …
angular ×3
aws-lambda ×2
f# ×2
asp.net-core ×1
c# ×1
go ×1
intellisense ×1
javascript ×1
node.js ×1
rxjs ×1