I am currently working on an Angular project for a class, and I'm facing an issue where removing the @Input decorator from my component is causing the entire application to not load properly.
import { Component, OnInit, Input } from '@angular/core';
import { Dish } from '../shared/dish';
import { DishService } from '../services/dish.service';
import { Params, ActivatedRoute } from '@angular/router';
import { Location } from '@angular/common';
@Component({
selector: 'app-dishdetail',
templateUrl: './dishdetail.component.html',
styleUrls: ['./dishdetail.component.scss']
})
export class DishdetailComponent implements OnInit {
@Input()
dish: Dish;
constructor(private dishservice: DishService,
private route: ActivatedRoute,
private location: Location) { }
ngOnInit() {
let id = +this.route.snapshot.params['id'];
this.dish = this.dishservice.getDish(id);
}
}
The @Input component does not seem to be utilized anywhere else in the application, and it doesn't appear to have strong relevance even within this specific component. Can someone shed light on why removing this decorator is causing my program to break?