I am trying to test my angular 4.1.0 component -
export class CellComponent implements OnInit {
lines: Observable>;
@Input() dep
What I would be doing is:
Add console.log() s, line after line in ngOnint() and find out how far it goes , then inspect the line which it wont pass through.
Ex:
ngOnInit() {
this.route.paramMap
.switchMap(params => {
this.busy = true;
this.updateErrors(null);
console.log(params);
**const id = params.get('id');**
console.log(id);
if (id === 'new') {
this.editMode = true;
return Observable.of(GroupComponent.newGroup());
}
return this.apiService.getGroup(id);
})
}
This was failing on my test with the same error in this post. As shown above, I had two console.logs. First one passed thorugh , but the second one not. So I realized the issue is on line const id = params.get('id'); and I fixed it.
Hope this will help someone.