I think you forget to inject your service into the component. You can inject your service into the provider[] section of the app.module.ts file or you can also inject it into the component file under the @Component decorator function like :
@Component({
selector: 'abc',
templateUrl: './abc.component.html',
styleUrls: ['./abc.component.css'],
providers:[myService] //inject your service here
})
After that create an instance of that service inside the constructor and call any method using that instance.
Mahesh VermaPosted Jun 29, 2018, 3:37 AM
Komal SharmaPosted Jun 29, 2018, 3:50 AM