title: Error during template compile of AppRoutingModule Function calls are not supported in decorators but RouterdataUrl was called
body: <p>I am building a production version of my project of angular 7
  and facing this error here is my code  of APP-Routing.Module.ts Code, It contains common Routes Values </p>
  
  <p>Here is Error Message: -ERROR in src\app\app-routing.module.ts(19,30): Error during template compile of 'AppRoutingModule'
    Function calls are not supported in decorators but 'RouterdataUrl' was called.</p>
  
  <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>    var con: RouterdataUrl = new RouterdataUrl();
      const routes: Routes = con.routerdata();
  
      @NgModule({
        imports: [RouterModule.forRoot(routes)],
        exports: [RouterModule]
      })
      export class AppRoutingModule { }
  
      export const routingComponents = [LeftmenuComponent, DasboardComponent, HeardermenuComponent, UserdiplayComponent,
        AdsServiceComponent, UsertaskdisplayComponent, WithdrwalComponent, AllplanComponent, DaywisereportComponent]
  
  
      function routerdata() {
        const Routes = [
          { path: 'leftmenu', component: LeftmenuComponent },
          { path: 'dasboard', component: DasboardComponent },
          { path: 'heardermenu', component: HeardermenuComponent }
        ];
        return Routes;
      }</code></pre>
  </div>
  </div>
  </p>
  
  <pre><code> And here is  APP MODULE CODE 
  
  <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>    //IMPORT....
      @NgModule({
        declarations: [
          AppComponent,
          routingComponents,
          WithdrwalComponent,
          UsertaskdisplayComponent,
          AllplanComponent,
          UsersqueryComponent,
          DaywisereportComponent
        ],
        imports: [
          BrowserModule,
          FormsModule,
          HttpClientModule, 
          BrowserAnimationsModule,
          ToastrModule.forRoot(),
          NgxLoadingModule.forRoot({}),
          AppRoutingModule
        ],
        providers: [],
        bootstrap: [AppComponent]
      })
      export class AppModule { }</code></pre>
  </div>
  </div>
  
  </code></pre>