title: Angular 4 call parent method in a child component
body: <p>I want to call parent method (deletePhone) in child component in Angular 4. 
  How can I do that properly?</p>
  
  <p>my parent component looks like:</p>
  
  <pre class="lang-typescript prettyprint-override"><code>export class ContactInfo implements OnInit {
      phoneForm: FormGroup;
      phones: Phone[];
  
  
      constructor(private fb: FormBuilder,
              private userService: UserService) {
      }
  
      ngOnInit() {
          this.userService.getDataPhones().subscribe(
              phones =&gt; {
                  this.phones = phones;
              });
  
          this.phoneForm = this.fb.group({
              phone: ['', [Validators.pattern(PHONE_PATTERN)]]
          });
      }
  
      deletePhone(phone: Phone) {
          this.userService.deleteUserPhone(phone)
              .subscribe(res =&gt; {
                  let index = this.phones.indexOf(phone);
                  if (index &gt; -1) {
                      this.phones.splice(index, 1);
                  }
          });
      }
  }
  </code></pre>