nativescript - Nativescript 8 和 Angular 12 延迟加载 => nsRouterLinkActive 不添加活动类
问题描述
我正在将一个项目从 NS 6.5 与 Angular 8.2 迁移到 NS 8.1 和 Angular 12.2 我遇到了 nsRouterLinkActive 指令的问题,该指令不起作用。我正在为我的模块使用延迟加载,就像这样
{ path: "mysettings", loadChildren: () => import("~/app/mysettings/mysettings.module").then((m) => m.MysettingsModule) }
然后在我的 app.component 中,我使用以下代码进行导航:
<Label text="" class="fas bottomButton" [nsRouterLink]="['/mysettings']" nsRouterLinkActive="active" pageTransition="slide"></Label>
导航工作正常,我的课程工作正常,但它从未被 nsRouterLinkActive 指令添加。有什么帮助吗?
解决方案
不尝试但查看文档,不应该nsRouterLinkActive
也用方括号括起来,即[nsRouterLinkActive]
?
推荐阅读
- sorting - 有maximumWith这样的东西吗?
- kubernetes - yaml 文件中创建 Kubernetes 仪表板时出错
- r - 如何计算期望值和方差,然后在 R 中从这个分布中模拟 500 个样本
- c - cuda 内核没有访问数组的所有元素
- javascript - 为什么我从 c# 到 js 得到不同的 MD5 哈希?
- node.js - 如何使节点需要来自 node_modules 的 es5 lib
- android - 有没有办法将 Koin 注入与泛型一起使用?
- android - 在 APK 中包含以下划线 (_) 开头的类加载器资源
- reactjs - 货币格式反应
- reactjs - 根据标志的值编写 React 应用程序