角度形式隐藏表达

时间:2017-08-28 16:48:29

标签: angular-formly

override func draw(_ rect: CGRect) {
    // [...]
    // your code untouched until this line:
    bezierPath.close()

    // change the rest of the function to:
    bezierPath.fill()

    UIGraphicsGetCurrentContext()!.setBlendMode(.sourceIn)
    let colors = [UIColor.green.cgColor, UIColor.blue.cgColor] as CFArray
    let gradient = CGGradient(colorsSpace: nil, colors: colors, locations: nil)
    let endPosition = min(frame.width, frame.height) / 2
    let center = CGPoint(x: bounds.size.width / 2, y: bounds.size.height / 2)
    UIGraphicsGetCurrentContext()?.drawRadialGradient(gradient!, startCenter: center, startRadius: 0.0, endCenter: center, endRadius: endPosition, options: .drawsAfterEndLocation)
}

在上面的形式json中,如何将hide表达式作为函数或如何从外部调用函数

1 个答案:

答案 0 :(得分:0)

Please refer the link below

**函数构造函数** Function构造函数创建一个新的Function对象。直接调用构造函数可以动态创建函数,但是遇到类似于eval的安全性和性能问题。