问题标签 [angular-cli-v7]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
angular - 使用jspdf和autotable获取表的所有数据
我想从我的表中获取所有数据,问题是我只获取第一页中的数据(因为分页)。我的桌子上有 200 个寄存器,但分页只显示了 100 个寄存器,我怎么能得到其他 100 个寄存器,它们在下一页中的 JSPDF 并使用 200 个寄存器生成 PDF。我的代码如下:
angular - 为什么我们需要在 angular prod build 中设置“--aot false”?
我知道“ ahead of time compilation
”在构建时提供编译。还有很多其他优点,--aot
例如
应用程序是预编译的,所以没有这样的等待模板
绑定错误将在构建时知道等。
但是,还有一个选项可以设置--aot
为 false(对于 prod 构建也是如此)。为什么我们需要设置--aot
为false
?换句话说,它--jit
提供了什么样的优势?我只是想了解使用--aot
over是否有任何缺点,--jit
因为否则,听起来--aot
即使在开发版本中我也应该始终使用。如果使用 没有权衡--aot
,那么为什么不将其设置为ng build
and的默认值ng serve
?
angular - Angular sharing modules between lazy loaded modules - cli creates unwanted chunks
Given 2 lazy loaded modules tableau-de-bord and import. These 2 modules are both importing a common shared-module which is actually shared between all the modules of the app.
My problem is, when I run ng serve or ng build, I should have let's say 2 chunks for the two modules. Instead, I have 3 (src-app-modules-import-import-module.js, src-app-modules-tableau-de-bord-tableau-de-bord-module.js and default~src-app-modules-import-import-module~src-app-modules-tableau-de-bord-tableau-de-bord-module.js).
When I first created the import module and ran ng serve, that default~src thing was not there. Some times later, it appeared.
Of course if I delete that file, one of the two modules will fail to load.
It is really annoying because when I load one of import or tableau-de-bord, that file is downloaded too and it also increases the final size of the app.
So why is creating this file and can I get rid of it? If yes, how?
Note that i have other modules that have the same issue. The app is holding 8 modules but this doesn't happen on all of them.
Edit: Turns out it is because the two modules linked are importing one same module. For instance, import-module and tableau-de-bord-module are both importing FontAwesomeModule (I only need it in these two). I've removed the import on import-module and the default~src was gone.
Then I tryed to put FonAwesomeModule inside shared-module hoping it will be available on the modules where I need it without creating another linked chunk but nope. The chunk got created every time I use font-awesome in both modules.
So there come the question. How can I share a module between modules without having that default~src stuff created?
Is it even a normal behaviour?
angular - 运行 npm install -g @angular/cli 时出错
如何解决问题,请帮忙。(如果是这样的话,互联网连接速度是否比最低要求要慢?) C:\Windows\system32> node -v v12.16.2 C:\Windows\system32> npm -v 6.14.4 C:\Windows \system32> npm install -g @angular/cli npm 错误!在 '...r\n"},"deprecated":"`' 附近解析时 JSON 输入意外结束