title: ng build --prod is not working properly? how to check this?
body: <p>i have one angular cli application. If i run that using <code>ng serve</code> command, it works fine.</p>
  
  <p>Instead of using <code>ng serve</code>, i used <code>ng build --prod</code>. it throws following script error:</p>
  
  <p>screenshot:</p>
  
  <p><a href="https://i.stack.imgur.com/XvYqU.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/XvYqU.png" alt="enter image description here"></a></p>
  
  <p><strong>i want to check this application in production mode.</strong></p>
  
  <blockquote>
    <p>Here i have attached my code:</p>
  </blockquote>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>import { Component, ViewChild, OnInit, ElementRef } from '@angular/core';
  import { DialogComponent } from '@syncfusion/ej2-angular-popups';
  import { EmitType } from '@syncfusion/ej2-base';
  @Component({
    selector: 'app-root',
    templateUrl: './app.component.html',
    styleUrls: ['./app.component.css']
  })
  export class AppComponent {
    title="test";
    @ViewChild('ejDialog') ejDialog: DialogComponent;
    // Create element reference for dialog target element.
    @ViewChild('container', { read: ElementRef }) container: ElementRef;
    // The Dialog shows within the target element.
    public targetElement: HTMLElement;
  
    //To get all element of the dialog component after component get initialized.
    ngOnInit() {
      this.initilaizeTarget();
    }
  
    // Initialize the Dialog component target element.
    public initilaizeTarget: EmitType&lt;object&gt; = () =&gt; {
      this.targetElement = this.container.nativeElement.parentElement;
    }
  
    // Hide the Dialog when click the footer button.
    public hideDialog: EmitType&lt;object&gt; = () =&gt; {
        this.ejDialog.hide();
    }
    // Sample level code to handle the button click action
    public onOpenDialog = function(event:any): void {
        // Call the show method to open the Dialog
        this.ejDialog.show();
    }
    //Animation options
    public animationSettings: Object = { effect: 'Zoom', duration: 400, delay: 0 };
    // Enables the footer buttons
    public buttons: Object = [
        {
            'click': this.hideDialog.bind(this),buttonModel:{ content:'OK', isPrimary: true }
        },
        {
            'click': this.hideDialog.bind(this),buttonModel:{ content:'Cancel' }
        }
    ];
  }</code></pre>
  </div>
  </div>
  </p>
  
  <blockquote>
    <p>Html file:</p>
  </blockquote>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;!--The content below is only a placeholder and can be replaced.--&gt;
  &lt;div style="text-align:center"&gt;
    &lt;h1&gt;
      Welcome to {{ title }}!
    &lt;/h1&gt;
    &lt;img width="300" alt="Angular Logo" src="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNTAgMjUwIj4KICAgIDxwYXRoIGZpbGw9IiNERDAwMzEiIGQ9Ik0xMjUgMzBMMzEuOSA2My4ybDE0LjIgMTIzLjFMMTI1IDIzMGw3OC45LTQzLjcgMTQuMi0xMjMuMXoiIC8+CiAgICA8cGF0aCBmaWxsPSIjQzMwMDJGIiBkPSJNMTI1IDMwdjIyLjItLjFWMjMwbDc4LjktNDMuNyAxNC4yLTEyMy4xTDEyNSAzMHoiIC8+CiAgICA8cGF0aCAgZmlsbD0iI0ZGRkZGRiIgZD0iTTEyNSA1Mi4xTDY2LjggMTgyLjZoMjEuN2wxMS43LTI5LjJoNDkuNGwxMS43IDI5LjJIMTgzTDEyNSA1Mi4xem0xNyA4My4zaC0zNGwxNy00MC45IDE3IDQwLjl6IiAvPgogIDwvc3ZnPg=="&gt;
  &lt;/div&gt;
  &lt;h2&gt;Dialog Component&lt;/h2&gt;
  
  &lt;button class="e-control e-btn" style="position: absolute;" id="targetButton" (click)="onOpenDialog($event)"&gt;Open Dialog&lt;/button&gt;
  &lt;div #container class='root-container'&gt;&lt;/div&gt;
    &lt;ejs-dialog id='dialog' #ejDialog header='Dialog' content='Dialog enabled with Zoom effect' [target]='targetElement'
    [animationSettings]='animationSettings' width='250px' [buttons]='buttons'&gt;
    &lt;/ejs-dialog&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>if i use the following command, it is working fine: What is the problem?</p>
  
  <p><code>ng build --prod --no-build-optimizer</code></p>