(source: any)
| 197 | } |
| 198 | |
| 199 | private update(source: any): void { |
| 200 | this.clearSource(); |
| 201 | |
| 202 | source = this.sourceAsObject(source); |
| 203 | |
| 204 | if (!types.isNullOrUndefined(source)) { |
| 205 | // TODO: if oneWay - call target.unbind(); |
| 206 | this.source = new WeakRef(source); |
| 207 | this.sourceOptions = this.resolveOptions(source, this.sourceProperties); |
| 208 | |
| 209 | const sourceValue = this.getSourcePropertyValue(); |
| 210 | this.updateTarget(sourceValue); |
| 211 | this.addPropertyChangeListeners(this.source, this.sourceProperties); |
| 212 | } else if (!this.sourceIsBindingContext) { |
| 213 | // TODO: if oneWay - call target.unbind(); |
| 214 | const sourceValue = this.getSourcePropertyValue(); |
| 215 | this.updateTarget(sourceValue ? sourceValue : source); |
| 216 | } |
| 217 | } |
| 218 | |
| 219 | public unbind() { |
| 220 | const target = this.targetOptions.instance.get(); |
no test coverage detected