Angular Injectable decorator - Expected 0 arguments but got 1

后端 未结 4 1656
臣服心动
臣服心动 2020-12-05 07:02

I am just getting started with the base tutorial for Angular but I face a small compilation issue.

I am following the tutorial on Angular\'s website. I am stuck with

4条回答
  •  渐次进展
    2020-12-05 07:25

    I also had this problem, and I have resolved it including the name of the class service in "Providers" in app.module.ts.

    like this:

    @NgModule({
        declarations:[
    
        ],
        imports:[
            CommonModule,
            HttpClientModule
        ],
        exports:[
    
        ],
        providers: [
            PostListService 
        ]
    })
    

提交回复
热议问题