Guest User

Untitled

a guest
Nov 16th, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.28 KB | None | 0 0
  1. @Component({
  2. selector: 'hello',
  3. template: `<h1>Hello {{name}}!</h1>`,
  4. changeDetection: ChangeDetectionStrategy.OnPush <========
  5. })
  6. export class HelloComponent {
  7. _name;
  8.  
  9. @Input() set name(name: string) {
  10. this._name = name;
  11. }
  12.  
  13. get name() {
  14. return this._name;
  15. }
  16. }
Add Comment
Please, Sign In to add comment