()
| 217 | } |
| 218 | |
| 219 | public unbind() { |
| 220 | const target = this.targetOptions.instance.get(); |
| 221 | if (target instanceof Observable) { |
| 222 | if (this.options.twoWay) { |
| 223 | target.off(`${this.targetOptions.property}Change`, this.onTargetPropertyChanged, this); |
| 224 | } |
| 225 | |
| 226 | if (this.sourceIsBindingContext && this.targetOptions.property !== 'bindingContext') { |
| 227 | target.off('bindingContextChange', this.bindingContextChanged, this); |
| 228 | } |
| 229 | } |
| 230 | |
| 231 | if (this.targetOptions) { |
| 232 | this.targetOptions = undefined; |
| 233 | } |
| 234 | |
| 235 | this.sourceProperties = undefined; |
| 236 | if (!this.source) { |
| 237 | return; |
| 238 | } |
| 239 | |
| 240 | this.clearSource(); |
| 241 | } |
| 242 | |
| 243 | // Consider returning single {} instead of array for performance. |
| 244 | private resolveObjectsAndProperties(source: Object, properties: Array<string>): Array<{ instance: Object; property: string }> { |
no test coverage detected