angular2 setup mock environment using JSON file

后端 未结 2 1340
执念已碎
执念已碎 2021-01-25 04:30

I am trying to set up a mock environments as follows inspired by this.

environment.mock.ts

export const environment = {
  production: fa         


        
2条回答
  •  梦谈多话
    2021-01-25 04:57

    Your json was malformed. Check the updated plunker link.

    plunker here

    mymodel.json:

    {
      "name" : "Test",
      "value" : "Test"
    }
    

    Inorder to do post, you have to use Mockbackend which is going to receive the post request. Check this answer

提交回复
热议问题