I have created an angular service called myCustomService and registered as shown in this post. I’m getting service without initializing so I’m not able to call any methods from myCustomService.
my custom service is like this
import { Injectable } from '@angular/core';
import { MatDialog } from '@angular/material';
import { OpenDialogComponent } from '../../components/open-dialog/open-dialog.component';
@Injectable({
providedIn: 'root'
})
export class MyCustomService {
constructor(private dialog: MatDialog) { }
openDialog() {
let dialogRef = this.dialog.open(OpenDialogComponent, {
width: '250px'
});
dialogRef.afterClosed().subscribe((data: boolean) => {
if (data) {
console.log(data);
}
});
}
}
It is not even hitting the custom provider’s method. If i create instance for that service in rtCamundaPropertiesProvider.ts then the provider methods are available and working fine. But my problem is I don’t create instance my class using new keyword. sharing any example which is having custom service is very helpful.
Thank you
Nagu