Так что ng serve и ng build компилируются и запускаются без ошибок.Когда я запускаю ng build prod, это дает мне свойство 'title' не существует для типа '{}'.Я устал от реализации интерфейса и получаю те же ошибки.Код отлично работает без ошибок с ng serve.
`<div class="row">
<div class="col-md-6">
<form #f="ngForm" (ngSubmit)="save(f.value)">
<div class="form-group">
<label for="title">Title</label>
<input #title="ngModel" [(ngModel)]="recipe.title" name="title" id="title" type="text" class="form-control" required>
<div class="alert alert-danger" *ngIf="title.touched && title.invalid">
Title is required
</div>
</div>`
Вот фрагмент файла Ts
export class RecipeFormComponent {
categories$: Observable<any>;
recipe = {};
id;
form = new FormGroup({
ingredients: new FormArray([])
});
constructor(
private categoryService: CategoryService,
private recipeService: RecipeService,
private router: Router,
private route: ActivatedRoute) {
this.categories$ = categoryService.getCategories();
this.id = this.route.snapshot.paramMap.get('id');
if(this.id) this.recipeService.get(this.id).take(1).subscribe(r => this.recipe = r);
}