Skip to content

Instantly share code, notes, and snippets.

@bharat-tiwari
Created March 14, 2018 05:03
Show Gist options
  • Save bharat-tiwari/7f1688c8190df95afa06152558ee938b to your computer and use it in GitHub Desktop.
Save bharat-tiwari/7f1688c8190df95afa06152558ee938b to your computer and use it in GitHub Desktop.
import {Component,Input,SimpleChanges} from '@angular/core';
@Component({
selector: 'item-details',
templateUrl: 'item-details.html',
})
export class ItemDetails {
private _item; // private property _item
// use getter setter to define the property
get item(): any {
return this._item;
}
@Input()
set item(val: any) {
console.log('previous item = ', this._item);
console.log('currently selected item=', val);
this._item = val;
this._item.status = 'In Process';
}
@Input() notifyItemProcessed: () => void;
suppliedQuantity: number;
scannedUPC: string;
errors: string[];
constructor(){}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment