Hi,
I am now getting the error:
*ERROR in node_modules/@angular/common/http/src/module.d.ts(88,23): error
TS1183: An implementation cannot be declared in ambient contexts.*
here is my service file:
import { Component, OnInit } from '@angular/core';
import { PubsService } from '../../services/pubs.service';
import { pubs } from '../../interface/pub';
import { Subscription } from 'rxjs';
@Component({
selector: 'app-services',
templateUrl: './services.component.html',
styleUrls: ['./services.component.scss']
})
export class ServicesComponent implements OnInit {
public pubsList;
subscription: Subscription;
constructor(private pubService: PubsService) {
this.pubService.getPubs().subscribe(result => this.pubsList = result);
}
ngOnInit(): void {
}
}
and here is where I am using it:
import { Component, OnInit } from '@angular/core';
import { PubsService } from '../../services/pubs.service';
import { pubs } from '../../interface/pub';
import { Subscription } from 'rxjs';
@Component({
selector: 'app-services',
templateUrl: './services.component.html',
styleUrls: ['./services.component.scss']
})
export class ServicesComponent implements OnInit {
public pubsList;
subscription: Subscription;
constructor(private pubService: PubsService) {
this.pubService.getPubs().subscribe(result => this.pubsList = result);
}
ngOnInit(): void {
}
}
*hmm is it because my classes are named the same?*
On Sunday, February 10, 2019 at 3:29:43 PM UTC, Sander Elias wrote:
>
> Hi John,
>
> Are you using `HttpClient`? If so, you don't need the response.json.
> Also, if you are not using httpClient, make sure you have imported the
> response type from angular. the response type that is on fetch is promised
> based and would result in exactly that error.
>
> Regards
> Sander
>
--
You received this message because you are subscribed to the Google Groups
"Angular and AngularJS discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.