title: Angular deployment - apiUrl does not exist on the type {production : boolean}
body: <p>I developed an Angular 7 App with Laravel backend. While trying to build and deploy  for production I got an error.</p>
  
  <blockquote>
    <p>src/app/services/user.service.ts(10,32): error TS2339: Property 'apiUrl' does not exist on type '{ production: boolean; }'.</p>
  </blockquote>
  
  <p>On the angular cli I ran this:</p>
  
  <blockquote>
    <p>ng build --prod</p>
  </blockquote>
  
  <p>environment.ts</p>
  
  <pre><code>export const environment = {
    production: false,
    apiUrl:   'http://example.com/api',   
  };
  </code></pre>
  
  <p>user.service.ts</p>
  
  <pre><code>import { Injectable } from '@angular/core';
  import { HttpClient } from '@angular/common/http';
  import { environment } from 'src/environments/environment';
  
  @Injectable({
    providedIn: 'root'
  })
  export class UserService {
  
   private API_URL= environment.apiUrl;
  
  
    constructor(private http: HttpClient) { }
  
    login(email, password) {
  const obj = {
    email: email,
    password: password
  };
  console.log(obj);
  this.http.post(this.API_URL + '/login', obj)
      .subscribe(res =&gt; console.log('login Done',res));
    }
  
  }
  </code></pre>
  
  <p>On</p>
  
  <blockquote>
    <p>ng build --prod</p>
  </blockquote>
  
  <p>I expect it to build then I put the dist file on the online server.</p>
  
  <p>This is the error:</p>
  
  <blockquote>
    <p>src/app/services/user.service.ts(10,32): error TS2339: Property 'apiUrl' does not exist on type '{ production: boolean; }'.</p>
  </blockquote>
  
  <p>Note: I am doing it for the first time.</p>