使用'ng serve'启动项目没有问题。 这样的错误信息。
import UIKit
class BubbleImageView: UIImageView {
var bubbleImage : UIImage? {
didSet {
let path = SwipeCard.bubblePath(frame: self.bounds)
DispatchQueue.global(qos: .background).async {
//background code
let newImage = self.createBubbleImage(source: self.bubbleImage, path: path)
DispatchQueue.main.async {
//your main thread
self.image = newImage
}
}
}
}
fileprivate func createBubbleImage(source: UIImage?, path: UIBezierPath) -> UIImage? {
var newImage : UIImage?
autoreleasepool {
UIGraphicsBeginImageContextWithOptions(self.bounds.size, false, 0)
path.addClip()
source?.draw(in: self.bounds)
newImage = UIGraphicsGetImageFromCurrentImageContext()
UIGraphicsEndImageContext()
}
return newImage
}
deinit {
bubbleImage = nil
image = nil
}
}
答案 0 :(得分:0)
在运行npm install
之前运行ng serve --prod
。在我看来,当AOT踢它时它无法找到动画包。