Before this component
was being loaded into MatDialog
but now the requirement is to load it on some url i.e. http://localhost:4200/some-url
and when I load this component via url and getting error
NullInjectorError: No provider for x!
Here is the component that I am trying to load on url.
export class MyComponent {
constructor(
public dialogRef: MatDialogRef<MyComponent>,
private fb: FormBuilder,
@Optional() @Inject(MAT_DIALOG_DATA) public data: any
) { }
}