Calling the WordPress API 

As we mentioned earlier, in the WordPress setup section, we have two different WordPress sites: one for staging and one for production. We need Angular to use a staging WordPress site while developing an Angular application and use a production WordPress site while building the application for production.

For this, we will utilize the environment files that Angular provides. By default, Angular provides two environment files: environment.ts and environment.prod.ts. The environment.ts file is imported into the application and used, and then when you build for production, Angular replaces the environment.ts file with environment.prod.ts. This makes it easier for us to support multiple environments. 

Let's edit our ...

Get Angular Projects now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.