Created
February 25, 2019 14:29
-
-
Save goughjo02/bf58b3848a7f8481d8750f4339f13109 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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