Answer the question
In order to leave comments, you need to log in
How to correctly test a class in angular?
The question may not be the most important, and many rather pass by, because if it works in the browser window, then it’s okay, but I want to get to the bottom of the truth. In short, there are three components in angular - all are registered, everything works, but ng test swears at the creation of the last component, where the class looks like:
import {Item} from "../item";
@Component({
selector: 'app-item',
templateUrl: './item.component.html',
styleUrls: ['./item.component.sass']
})
export class ItemComponent implements OnInit {
@Input('item') data : Item;
@Input('fir') fname : string;
*лишнее убрал
}
<app-item
*ngFor="let i of items"
[item]="i"
[fir]="fir">
</app-item>
this.items = [
new Item(" _f1", " _s1"),
new Item(" _f2", " _s2"),
];
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question