angular2-aot

AOT - Function calls are not supported Module.forRoot

你说的曾经没有我的故事 提交于 2021-01-29 04:39:22
问题 I've been trying to compile my Angular app using AOT with @angualar/compiler-cli but I've been ending up with an error during compiling which I am not able to solve. The error states: Error encountered resolving symbol values statically. Calling function 'PanelModule', function calls are not supported. Consider replacing the function or lambda with a reference to an exported function. I have my main AppModule and another module called, PanelModule . In PanelModule I have a forRoot method that

AOT - Function calls are not supported Module.forRoot

萝らか妹 提交于 2021-01-29 04:38:39
问题 I've been trying to compile my Angular app using AOT with @angualar/compiler-cli but I've been ending up with an error during compiling which I am not able to solve. The error states: Error encountered resolving symbol values statically. Calling function 'PanelModule', function calls are not supported. Consider replacing the function or lambda with a reference to an exported function. I have my main AppModule and another module called, PanelModule . In PanelModule I have a forRoot method that

Angular Dynamic Components AOT Issue

安稳与你 提交于 2021-01-28 02:07:35
问题 Due to some business logic, I have to read the meta data of dynamic components(EntryComponents). To read the meta data, following is my approach. Read all components of a module using ComponentFactoryResolver Filter out classes using Component name and specific method Create the component and read the data Destroy the component. . const factories = Array.from<any>(this.resolver['_factories'].keys()); console.log(factories); // Logging all the factories factories.forEach(element => { if

Property 'xxxx' does not exist on type '{ [key: string]: AbstractControl; }'

本小妞迷上赌 提交于 2020-06-18 10:27:51
问题 import { FormGroup } from '@angular/forms'; export class MasterVendorFormContactComponent implements OnInit { @Input() formContactGroup: FormGroup; // rest of the code } <fieldset [formGroup]="formContactGroup" class="master-vendor-form-contact"> <md-input-container class="master-vendor-form-contact__phone" [dividerColor]="formContactGroup.controls.phone?.valid ? 'default' : 'warn'"> <input mdInput placeholder="Enter phone" formControlName="phone"> <md-hint align="end" *ngIf="

Property 'xxxx' does not exist on type '{ [key: string]: AbstractControl; }'

眉间皱痕 提交于 2020-06-18 10:27:13
问题 import { FormGroup } from '@angular/forms'; export class MasterVendorFormContactComponent implements OnInit { @Input() formContactGroup: FormGroup; // rest of the code } <fieldset [formGroup]="formContactGroup" class="master-vendor-form-contact"> <md-input-container class="master-vendor-form-contact__phone" [dividerColor]="formContactGroup.controls.phone?.valid ? 'default' : 'warn'"> <input mdInput placeholder="Enter phone" formControlName="phone"> <md-hint align="end" *ngIf="

Property 'xxxx' does not exist on type '{ [key: string]: AbstractControl; }'

蹲街弑〆低调 提交于 2020-06-18 10:27:01
问题 import { FormGroup } from '@angular/forms'; export class MasterVendorFormContactComponent implements OnInit { @Input() formContactGroup: FormGroup; // rest of the code } <fieldset [formGroup]="formContactGroup" class="master-vendor-form-contact"> <md-input-container class="master-vendor-form-contact__phone" [dividerColor]="formContactGroup.controls.phone?.valid ? 'default' : 'warn'"> <input mdInput placeholder="Enter phone" formControlName="phone"> <md-hint align="end" *ngIf="

Why does angular project fail AoT build when injecting Interfaces?

江枫思渺然 提交于 2020-01-24 21:55:32
问题 Ok, sorry if the title was not clear. I'm trying to implement a pattern involving injecting interfaces. It works perfectly in JIT but not in AoT. I was hoping to get an explanation of why this doesn't work and hopefully some suggestions to make it work. Here's a simplified example of the pattern. data-manager.interface.ts @Injectable() export class DataManager implements DataManager {} export interface DataManager { getData(): Promise<Array>; ... } ^Declares Interface dashboard.service.ts

Angular AoT and Rollup - Error: Runtime compiler is not loaded

拥有回忆 提交于 2020-01-24 14:05:55
问题 I have a been building a dashboard application using Angular for the last 6 months in that time I have had a really nice development workflow using JiT compilation and gulp browser sync to get instant updates when I make changes. Which has worked great. I have come to the point where I am happy to deploy a production version, however, I have run into issues with AoT and rollup. I have followed the angular.io guide but got the following ERROR Error: Uncaught (in promise): Error: Runtime

Class has or is using name 'SafeUrl' from external module but cannot be named

╄→尐↘猪︶ㄣ 提交于 2020-01-07 02:26:18
问题 I'm using sanitizer.bypassSecurityTrustUrl to put links to blobURL's on the page. This works just fine as long as I don't AoT compile the project. import {DomSanitizer} from '@angular/platform-browser'; export class AppComponent { constructor(private sanitizer: DomSanitizer) { } sanitize(url: string) { return this.sanitizer.bypassSecurityTrustUrl(url); } } The sanitize function takes a URL like this: blob:http://localhost:4200/7c1d7221-aa0e-4d98-803d-b9be6400865b If I use AoT compilation I

Angular 2 Aot Error: 'ToastsManager' is not exported

妖精的绣舞 提交于 2020-01-05 03:54:04
问题 While performing AOT I'm facing issue with ng2-toastr which I'm using ToastsManager' is not exported by 'node_modules\ng2-toastr\src\toast-manager.js 'ToastModule' is not exported by 'node_modules\ng2-toastr\src\toast.module.js'. 'ToastOptions' is not exported by 'node_modules\ng2-toastr\src\toast-options.js'. Any idea on how to resolve this? I checked all those mentioned files, they have export declare keywords with them, even checked with this site https://github.com/rollup/rollup/wiki