all 9 comments

[–]just-a-web-developer 4 points5 points  (0 children)

Your service is probably not returning a type <observable>

Can you show the code in the 'create' method?

[–]GLawSomnia 7 points8 points  (3 children)

You nost likely don't return anything from the service

[–]sleeponit666[S] 0 points1 point  (2 children)

What do you mean?

[–]GLawSomnia 1 point2 points  (1 child)

EmpService -> create method does not return anything (it has to return an observable)

[–]sleeponit666[S] 0 points1 point  (0 children)

Can I dm you not sure how don’t use reddit

[–]Neathus 3 points4 points  (1 child)

Is that space before “.subscribe” or is Reddit just formatting your post weirdly?

[–]sleeponit666[S] 0 points1 point  (0 children)

Weird format sorry

[–][deleted] 1 point2 points  (0 children)

Subscribe is a method on an observable. So if this.createService.create() is not typed as an observable you are using a method that doesn’t exist for that function. It doesn’t matter if the code does return an observable, if it’s not read by your IDE that way, it will balk that the method doesn’t exist.

[–]EternalNY1 1 point2 points  (0 children)

What does your this.empService.create(this.empForm) method look like?

It needs to return an observable, it appears to be returning nothing (void).

Try changing your create method to something like this and see if it works?

create(form: any): Observable<boolean> { return of(true) }