angular2-aot

How to import exporting.js and export-data.js using angular2-highcharts and AOT compiler?

限于喜欢 提交于 2019-12-11 16:23:27
问题 I'm using angular2-highcharts and my chart works just fine, but I need to export the chart to XLS. All I need to achieve this is doing HighchartsExporting(Highcharts); HighchartsExportData(Highcharts); somewhere in the code, and the export options will show up by the chart. The problem is how to import HighchartsExporting and HighchartsExportData properly, because the standard solution @NgModule({ imports: [ BrowserModule, ChartModule.forRoot( require('highcharts'), require('highcharts

AngularCli & AOT: ERROR Error: Runtime compiler is not loaded

喜夏-厌秋 提交于 2019-12-11 10:58:26
问题 I'm trying to build my Angular4 application with Ahead of Time. The build process runs fine and without errors, but when I run the application I receive this error in console: ERROR Error: Runtime compiler is not loaded at J (vendor.ac8dafb82366354245dd.bundle.js:1) at t.compileModuleSync (vendor.ac8dafb82366354245dd.bundle.js:1) at t.QFu1.t.createDynamicTemplate (vendor.ac8dafb82366354245dd.bundle.js:1) at t.QFu1.t.ngDoCheck (vendor.ac8dafb82366354245dd.bundle.js:1) at xn (vendor

AOT and JIT with build-optimizer

别来无恙 提交于 2019-12-11 03:35:45
问题 I am following the solution here of using the JitCompilerFactory to load the runtime compiler and custom decorators to preserve the component and module metadata. But with the angular-cli --build-optimizer flag I get: ERROR Error: Cannot resolve all parameters for 'Parser'(?). Make sure that all the parameters are decorated with Inject or have valid type annotations and that 'Parser' is decorated with Injectable. Here is my minimal reproduction, run ng serve --aot --build-optimizer . As a

Angular2 CLI: why bundle size of “--prod” smaller than “--prod --aot”?

≡放荡痞女 提交于 2019-12-10 12:56:08
问题 I'm using the latest angular-cli (beta-18) for a project. I know the cli is still in very early stages, but I'm perplexed as to why my final bundle size is actually smaller without AoT. When I run ng build --prod , it's 1.08 mb: Asset Size Chunks Chunk Names main.53d637ff9422b65418e6.bundle.js 1.08 MB 0, 2 [emitted] main styles.01cffb95000fdb84402c.bundle.js 8.9 kB 1, 2 [emitted] styles inline.js 1.45 kB 2 [emitted] inline main.53d637ff9422b65418e6.bundle.map 7.24 MB 0, 2 [emitted] main

Aot and minification failing in Angular 4 with external modules

不问归期 提交于 2019-12-10 09:34:36
问题 I am using Angular CLI to build an Angular 4 app. Before deployment to prod, I would like to do aot and minification. So I executed the following command ng build --environment=prod --prod --base-href /myapp/ This gives me the below error ERROR in Error encountered resolving symbol values statically. Calling function 'ControlValueAccessorProviderFactory', function calls are not supported. Consi der replacing the function or lambda with a reference to an exported function, resolving symbol

Production compilation with ejected Angular 4 application produces large files

谁说我不能喝 提交于 2019-12-10 02:23:42
问题 ng build --prod Angular CLI command produces highly compressed javascript files in Angular4 application. When the application is ejected using ng eject command, Angular CLI commands are gone and we are left with npm scripts( npm run build command to build the app), but unfortunately that command outputs a non-production build. I tried running webpack -p command directly but the output result files are slightly larger compared to the output of ng build --prod command. How to get a compression

Error encountered resolving symbol values statically. Calling function 'CreateCustomComponent', function calls are not supported

和自甴很熟 提交于 2019-12-08 02:01:53
问题 I am getting below error when creating my custom component. Error encountered resolving symbol values statically. Calling function 'CreateCustomComponent', function calls are not supporte d. Consider replacing the function or lambda with a reference to an exported function, resolving symbol cus_input my file like as below. Any one please give me a answer for below my code ? export class MyComponent { constructor() { console.log("Component created"); } } export function CreateCustomComponent(

Deploying angular 2 app Aot with Rollup and external dependencies

五迷三道 提交于 2019-12-06 11:10:35
I've implemented an angular 2 app which utilize Kendo UI Grid : I am stuck when deploying app with AoT + Rollup: Error: 'GridModule' is not exported by node_modules\@progress\kendo-angular-grid\dist\npm\js\main.js (imported by app\app.module.js). Tried this from Rollup documentation but I don't understand how to configure namedExports : commonjs({ namedExports: { 'node_modules/@progress/kendo-angular-grid/dist/npm/js/main.js': [ 'GridModule' ] } }); Using above configuration doesn't solve the problem. EDIT: finally my working configuration for grid is: namedExports: { '@progress/kendo-angular

Angular 2, @ngtools/webpack, AOT

被刻印的时光 ゝ 提交于 2019-12-06 09:48:50
I'm trying to use AOT in Angular 2 using webpack and @ngtools/webpack. I don't have any error with the compilation, but when I open the site on the browser I get a console error: No NgModule metadata found for 'AppModule' My AotPlugin on webpack configuration is this: new AotPlugin({ tsConfigPath: 'tsconfig.json', entryModule: helpers.root('src/app/app.module.ts#AppModule') }) My app.module.ts is: @NgModule({ bootstrap: [ App ], imports: [ // import Angular's modules BrowserModule, RouterModule.forRoot(ROUTES), SharedModule ], declarations: [ App, HomeComponent, ], providers: providers })

Error encountered resolving symbol values statically. Calling function 'CreateCustomComponent', function calls are not supported

折月煮酒 提交于 2019-12-06 08:09:43
I am getting below error when creating my custom component. Error encountered resolving symbol values statically. Calling function 'CreateCustomComponent', function calls are not supporte d. Consider replacing the function or lambda with a reference to an exported function, resolving symbol cus_input my file like as below. Any one please give me a answer for below my code ? export class MyComponent { constructor() { console.log("Component created"); } } export function CreateCustomComponent( componentArgs: { selector: string, inputs: Array<string>, template: string }): Type<any> { let comp =