-
0 votes1 answers863 views
Angular CLI - ng build期间的AOT错误
我使用Angular CLI创建了一个应用程序,它可以与JIT编译一起使用 . 我觉得我需要更快地使我的应用程序,所以我计划将应用程序从JIT转换为AOT . 我按照angular.io提到的说明进行操作 https://angular.io/guide/aot-compiler 这个文件 . 我成功转换了步骤,这有助于我们将所有文件转换为ngFactory,完成了汇总过程而没有错误 . 我执行 ... -
0 votes0 answers102 views
Angular AoT编译和同步注入?
是否可以使以下代码与AoT兼容? interface Config { someField?: string; anotherField?: number; } @NgModule({}) export class SomeModule { protected static _config: Config; public static withConfig(co... -
2 votes0 answers599 views
编译 生产环境 版本时出现Angular2 AOT问题 - app模块问题
编译 生产环境 版本时出现Angular2 AOT问题 - app模块问题 我正在使用angular2,typescript,html5和systemjs 这是我正在使用的angular2种子应用程序:https://github.com/mgechev/angular-seed 当我这样做git bash命令时:npm运行serve.prod.exp,为AOT创建一个构建包 . 然后我在git... -
6 votes1 answers1033 views
如何调试角度2 aot故障
我有一个由ng cli生成的角度2应用程序 . - 当我运行build(或)ng build --prod --aot = false并提供页面时,一切正常 . - 但是当我尝试通过运行ng serve --aot = true并提供服务来启用aot时,页面会出现多个DI错误,如下所示很难调试 . 有关如何调试这些问题的任何想法? 例外:没有选项提供商!error_handler.js:5... -
3 votes1 answers970 views
TypeError:Angular2 AoT编译错误:createAotCompiler不是函数
我试图按照angular.io网站上的AOT编译指南,但当我执行下面显示的命令时,"node_modules/.bin/ngc" -p tsconfig-aot.json 我收到了错误 TypeError: compiler.createAotCompiler is not a function at Function.CodeGenerator.create (pat... -
1 votes0 answers1021 views
AOT样本中的样本路径不匹配
我正在尝试创建Angular 2样本ngc和JIT编译器 . 使用JIT编译器,我可以运行示例但是使用ngc编译器时遇到了component.html文件路径的问题 . npm run ngc [email protected] ngc E:\ AOT \ seed-application-changes \ sample-AOT“node”copy-dist-f... -
1 votes0 answers1927 views
Angular AOT构建失败
D:\server7\OSPanel\domains\bb.ru\src_angular\admin\src\$$_gendir\app\app.module.ngfactory doesn't exist .ts Field 'browser' doesn't contain a valid alias configuration D:\server7\OSPanel\dom... -
0 votes0 answers82 views
角度 - ng构建中的错误 - 很多
我用Angular-cli创建了一个应用程序,当我运行 ng serve 或 ng build 时一切正常,我没有任何错误;但是当我运行 ng build -aot 时,我有以下错误: 子编译中的错误失败:模块构建失败:错误:使用“extract-text-webpack-plugin”加载器而没有相应的插件参考https://github.com/webpack/extract-text-we... -
3 votes1 answers1882 views
Angular 4.1.3使用AOT时,Service Factory返回undefined
在我的Angular应用程序中,我使用共享服务,因为数据不断更新,所以我不需要成为单例 . 服务厂: import {DataService} from '../../../../shared/services/data.service'; import {Http} from '@angular/http'; export const DataServiceProvider = { p... -
1 votes2 answers1901 views
如何发布在AoT angular2应用程序中使用的包
我有一个用angular2打字稿编写的代码,这是一个用服务和组件导出的模块 @NgModule({ declarations:[ ...DECLARATIONS ], imports: [ CommonModule, ChartModule ], exports:[ ...DECLARATION... -
0 votes0 answers932 views
更新为@ angular / cli 1.0.0 rc1后的角度cli错误
在更新到最新版本的angular cli之后,我会遇到类似于下面的错误 ERROR in Error遇到静态解析符号值 . 不支持函数调用 . 考虑使用对导出函数的引用替换函数或lambda(原始.ts文件中的位置19:46),解析/src/app/custom-error-handler.ts中的符号CUSTOM_ERROR_PROVIDER,解析src / app中的符号AppModule ... -
0 votes0 answers651 views
Angular 5 AOT编译引发错误
我试图使用AOT编译首次启动我的Angular5应用程序,并在尝试此操作时出现以下错误 . compiler.js:20242 Uncaught Error: No NgModule metadata found for 'AppModule'. at NgModuleResolver.resolve (compiler.js:20242) at CompileMetadataRe... -
0 votes1 answers0 views
是否可以动态地将带有角度组件的html模板加载到AOT编译的角度应用程序中?
在我的角度应用程序中,后端用户可以创建自定义模板 . 这些自定义模板需要在特定位置的角度应用程序中加载 . 我有一个自定义指令,它从CMS获取模板(基于路由)并将其注入我的角度应用程序 . 如果我将它放入 innerHTML ,组件将无法正确呈现 . 我需要 componentFactoryResolver 和 compiler 来正确显示组件 . 上述解决方案不适用于 AOT 编译 . 有没有其... -
0 votes0 answers1061 views
Ng2 Nativescript Webpack - ERROR in无法解析模块@ angular / core
我有angular2 Nativescript项目,我已经实现了延迟加载 . 我现在正在尝试使用AOT按照nativescript给出的指示实现webpack - 这里 . 因此,我安装了插件:nativescript-dev-webpack和 . 现在当我运行时,npm运行start-android-bundle,我收到以下错误: `ERROR in Could not resolve mod... -
4 votes1 answers1811 views
为什么Angular 2有模板的JiT编译?
在运行时期间在浏览器中对Angular 2 HTML模板进行JiT编译的理由是什么? 我知道,_742291存在解决这个问题的方法,它大大提高了启动性能 . 我不是在问我是否应该使用JiT或AoT编译 . TypeScript编译器能够编译JSX,这是否意味着,有一天我们得到相同的支持Angular 2模板作为 @angular/compiler-cli 的替代? -
4 votes0 answers1074 views
Angular 2延迟加载模块使用aot和不同的管道
我正在一个大型应用程序中工作,我们希望有lazyload模块以提高性能,但我们希望使用AOT(性能),同时我们希望保留单独的管道,以便仅部署更改的模块与其他人没有任何依赖关系 . 我们正在几个专注于不同模块的团队中工作 . 在经过大量调查后,我找不到任何办法 . 有没有人有同样的问题? 一切都适用于JIT,在不同的管道中有不同的javascript文件,我们尝试在AOT中只编译一个构建过程中的所有... -
0 votes1 answers1840 views
Angular2:JIT和AOT编译器之间的区别以及哪个更适合构建angular2应用程序? [重复]
这个问题在这里已有答案: Angular 2 : Just-in-Time (JiT) vs Ahead-of-Time (AoT) compilation 7个答案 What is the difference between Angular AOT and JIT compiler 3个答案 在阅读Angular2文档时,我开始知道: Angular提供了两种编译应用程序的方法: ... -
5 votes1 answers1089 views
创建一个由Angular应用程序使用的Ahead(AOT)编译库
我有一个Angular 5库,我公开它作为一个包,供其他应用程序使用 node_modules . 目前,该应用程序是使用 rollup 和 gulp 编译的即时(JIT)并作为包导出 . 因此开发人员应用程序在其JIT编译形式中使用我的包 . 关于AOT的研究让我相信任何在AOT编译时的Angular应用程序比浏览器上的JIT对应程序更高效 . 但是,作为一个库开发人员,我想知道如果我公开我的... -
1 votes0 answers1203 views
使用AOT时,Angular 2无法导入模块
我有一个简单的角度模块,什么都不做: index.ts : export * from './my.module'; my.module.ts : import {NgModule} from "@angular/core"; @NgModule() export class MyModule {} 我在我的主应用程序中导入了这个模块: import {MyModule} f... -
1 votes0 answers1255 views
Angular2 / angular-cli:尝试使用aot构建时出现奇怪的错误
我正在尝试使用最新版本的angular-cli v1.0.0-rc.2构建一个Angular2应用程序 . 当使用--prod开关构建时,此版本的angular-cli默认使用默认编译 . 由于某些未知原因,当我尝试使用--prod进行编译时,事情总是出错 . 我可以在使用--aot = false参数关闭aot时编译,但我想使用aot构建,因为我的应用程序在没有--aot部署时运行有点慢 . 我... -
3 votes0 answers820 views
如何使用platformBrowser而不是platformBrowserDynamic与maint.ts中的angular-cli应用程序在aot模式下引导应用程序?
我正在使用带有aot = true和--prod的角度cli构建应用程序,因此应用程序可以使用aot进行编译,并且包大小更小,但是如何在aot模式下引导应用程序以便引导速度更快,如this article中所述? 当前代码: import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; import { en...