I am trying to follow the docs on https://material.angular.io/components/component/dialog but I cannot understand why it has the below issue?
I added the below on my
If someone needs to call Dialog from services here is how to solve the issue. I agree with some of above answer, my answer is for calling dialog in services if someone may face issues on.
Create a service for example DialogService then move your dialog function inside the services and add your dialogservice in the component you call like below code:
@Component({
selector: "app-newsfeed",
templateUrl: "./abc.component.html",
styleUrls: ["./abc.component.css",],
providers:[DialogService]
})
otherwise you get error