如果在我的角应用程序的主模块中有下面的场景,会发生什么?
在app.module.ts上,我使用forRoot()导入模块TranslateModule,以配置它并使其对所有应用程序可用。在shared.module.ts中,我导出该模块,以便其他模块可以使用它。在shared.module.ts中,我还导出服务,因此我创建了forRoot()方法,并将它导入到app.module.ts中。
这样,我将导入两次TranslateModule。一个直接在app.module.ts中使用forRoot表单,另一个通过shared.module.ts。这样做有什么问题吗?如果它存在,如何解决它?
a
我试图在一个角11应用程序中使用auth0/auth0-angular库。
我正在关注上的部分。
它提供了以下示例应用程序模块代码:
// app.module.ts
// ---------------------------
import { AuthModule, AuthClientConfig } from '@auth0/auth0-angular';
// Provide an initializer function that returns a Promise
function configInitializer(
handler: HttpBacken
我一直在尝试使用AOT和@angualar/编译器-cli来编译我的Angular应用程序,但是在编译过程中我遇到了一个错误,我无法解决这个问题。错误状态为:
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.
我有我的主Ap
我正在一点一点地将一个大型angular.js应用程序(使用ui路由器)迁移到that,我选择了使用angular.js应用程序作为基础,并一次迁移不同的路由,这样,一旦我完成任务,我就会立即切换到角度。
以下是我遵循的步骤:
引导我的angular.js文件中的main.ts应用程序:
export function bootstrapAngular(extra: StaticProvider[]): any {
setAngularJSGlobal(angular);
if (environment.production) {
enableProdMode();
}
我有angular 6的应用程序。我有获得动态路由的需求,其中的逻辑已经排序。我有一个AppRoutingService类,它有返回静态路由集合的getAppRoutes()方法。我需要这个被称为app RouterModule.forRoot(...),目标是如果可以使用服务类注入静态路由,那么我就可以在这个静态列表中从数据库中组装动态路由。 在这样做的过程中,我得到了错误。 错误 Uncaught TypeError: Cannot read property 'appRoutingService' of undefined
at main.js:1055
at Modu
我使用这里的文档创建了一个库:
现在,我在我的库中有了一些组件、指令和服务,我想把它们分成不同的模块。我创建了独立的模块,并在public-api.ts文件中引用它们,如下所示:
export * from './lib/animations/animations.module';
export * from './lib/breadcrumb/breadcrumb.module';
export * from './lib/directives/directives.module';
export * from './lib/foote