To fix this error:

Property 'ngOnInit' is missing in type 'BookDownloadModalComponent' but required in type 'OnInit'.

Solution

Make sure the order and naming is correct. Don't use OnInit, but ngOnInit. An example of my book-download-modal-component.ts:

import {Component, OnInit} from '@angular/core';
import {Book} from '../../../../../core/models/book';

@Component({
  selector: 'app-book-download-modal',
  templateUrl: './book-download-modal.component.html',
})
export class BookDownloadModalComponent implements OnInit {
  @Input() book!: Book;

  constructor(
  ) {
  }

  // make sure this is AFTER the constructor
  ngOnInit() {
    console.log(this.book);
  }

}