在Typescript中使用await / async和observables

时间:2018-01-19 17:47:39

标签: angular typescript promise rxjs observable

我尝试进行api调用并使用异步代码分配结果。这就是我所拥有的。

let bottomBorder = CALayer()

bottomBorder.frame = CGRect(x: 0.0, y: 43.0, width: cell.contentView.frame.size.width, height: 1.0)
bottomBorder.backgroundColor = UIColor(white: 0.8, alpha: 1.0).cgColor
cell.contentView.layer.addSublayer(bottomBorder)

到代码完成时,信息未定义'。我怎样才能使这个方法异步?

0 个答案:

没有答案