Skip to content

Instantly share code, notes, and snippets.

@goughjo02
Created February 25, 2019 14:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save goughjo02/bf58b3848a7f8481d8750f4339f13109 to your computer and use it in GitHub Desktop.
Save goughjo02/bf58b3848a7f8481d8750f4339f13109 to your computer and use it in GitHub Desktop.
@Component({
selector: "example-component",
templateUrl: "./example.html"
})
export class ExampleComponent implements OnInit {
_objectValue: any;
@Input()
get object() {
return this._objectValue;
}
@Output() objectChange = new EventEmitter();
set object(val) {
this._objectValue = val;
this.objectChange.emit(this._objectValue);
}
constructor() {}
ngOnInit() {}
}
// Example Usage:
// <example-component [(object)]="someParnetObject" />
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment