小编Fah*_*que的帖子

NullInjectorError: 没有 String 的提供者!在角 6

父类

import { BadRequestError } from './../common/bad-request-error';
import { NotFoundError } from './../common/not-found-error';
import { AppError } from './../common/app-error';
import { Http } from '@angular/http';
import { Injectable, OnInit } from '@angular/core';
import { catchError } from 'rxjs/operators';
import { throwError} from 'rxjs';

@Injectable({
  providedIn: 'root'
})
export class DataService {
  constructor(private url: string , private http: Http) {
 }

getAll() {
 return this.http.get(this.url).pipe(catchError(this.handleError));
}

delete(id) {
  return this.http.delete(this.url + '/' + id)
   .pipe(
    catchError(this.handleError));
 }

update(resource) {
  return this.http.patch(this.url …
Run Code Online (Sandbox Code Playgroud)

dependency-injection angular

6
推荐指数
1
解决办法
5722
查看次数

标签 统计

angular ×1

dependency-injection ×1