| 49 | protected _columnsDiffer!: IterableDiffer<any>; |
| 50 | |
| 51 | ngOnChanges(changes: SimpleChanges<this>): void { |
| 52 | // Create a new columns differ if one does not yet exist. Initialize it based on initial value |
| 53 | // of the columns property or an empty array if none is provided. |
| 54 | if (!this._columnsDiffer) { |
| 55 | const columns = (changes['columns'] && changes['columns'].currentValue) || []; |
| 56 | this._columnsDiffer = this._differs.find(columns).create(); |
| 57 | this._columnsDiffer.diff(columns); |
| 58 | } |
| 59 | } |
| 60 | |
| 61 | /** |
| 62 | * Returns the difference between the current columns and the columns from the last diff, or null |