- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
我有一些组件,其中一个带有动态路由。
动态路由被添加为,
let config = [];
for(let i = 0; i < this.pages.length; i++) {
config.push({
path: this.pages[i].slug,
name : this.pages[i].name,
component: AnotherComponent,
});
}
router.config(config);
每当动态路由的组件被多次加载时,都会重新配置路由,导致配置冲突。
这是 plunk ,动态路由加载了链接 users
,在离开 user 后再次单击 users
将下面显示的错误记录到控制台。
我该如何解决?感谢您调查此事。
最佳答案
添加之前检查路由是否存在
for(let i = 0; i < this.pages.length; i++) {
if(!router.registry.hasRoute(this.pages[i].name, UsersComponent)) {
config.push({
path: this.pages[i].slug,
name : this.pages[i].name,
component: PersonComponent,
data : {
name : this.pages[i].name,
slug : this.pages[i].slug
}
});
}
}
关于 Angular 2 : Configuration 'name' conflicts with existing route 'name' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36114571/
Postgres 10 和 11 的插入规范说: ON CONFLICT [ conflict_target ] conflict_action 我有一张 table : create table c
我的理解是conflict serializable 隐含serializable。我不确定这如何让他们与众不同。可序列化是否意味着冲突可序列化? 最佳答案 冲突可序列化是可序列化的一个子集,因此仅仅
在数据库理论中,“冲突可序列化”和“冲突等价”有什么区别? 我的教科书有一节是关于冲突可序列化的,但掩盖了冲突等价性。这些可能都是我熟悉的概念,但我不熟悉术语,所以我正在寻找解释。 最佳答案 DBMS
我有一个项目一直在 Xcode 4.4.1 中进行,我想回到以前的分支。(注意分支并不复杂,而是代表线性发展) 当我选择上一个分支时有一个警告 UserInterfaceState.xcusersta
我得到了一个 environment.ubuntu.yml文件,以便能够创建 conda 环境。但是,运行 conda create env --file environment.ubuntu.yml
我浏览了互联网,找不到我的问题的清晰简洁的答案。我想知道如果我将相同强度的信号驱动到同一根电线上会发生什么,其中一个是逻辑 1,另一个是逻辑 0?如果我想要一个“获胜”的信号,因为没有更好的词,我该怎
我在2个网站上有2个不同的图片: http://www.siteA.com/avatar.png http://www.siteB.com/avatar.png 如果我创建具有2个起源的Amazon
我正在 Labview 中开发一个数据采集程序,该程序使用多个转换阶段、相机、高速数字化仪和其他仪器。我正在一台计算机上开发该应用程序,并将其部署到另一台计算机上。开发计算机有labview 2013
能否请您帮助我理解为什么乐观并发更新会有这样的结果。 比如说,我有以下文件: { "phrase": "some phrase", "id": "5d1341797e2ed599", "_
我想安装这两个包: “anahkiasen/前任”:“开发大师” "vespakoen/menu": "dev-master" 但是 composer 说它们每个都依赖于这个包的不同版本: "anah
我在运行 powershell 时遇到以下错误 $thumbprint=$(az webapp config ssl upload --certificate-file $Path --certifi
我不太确定这是否是我使用的 SQLite 版本的问题。但实际上我并没有直接使用 native SQLite (dll),我使用的是 System.Data.SQLite 版本 1.0.108.0 看起
我有一个具有 iBeacon 服务和标准 BLE 服务的芯片。 我想使用 iBeacon 服务在进入 BLE 信号范围时触发我正在开发的应用。 激活后,我希望应用程序使用 CoreBluetooth
建表语句: ? 1
我使用此链接中的示例创建了测试 Telegram 机器人控制台应用程序 https://github.com/TelegramBots/Telegram.Bot.Examples 这是我的主要 pub
我有这个 hpp 文件: struct rte_spinlock_t; class A { public: void init(); private:
我已经从 GitHub 中提取了文件。现在我需要创建一个合并冲突。 如何在 GitHub 上故意创建合并冲突? 最佳答案 在两个分支中编辑同一行,并尝试合并 Merge conflicts in gi
我是这个 repo 的管理员。在这个 PR 中,我删除了多个文件并将这些更改从本地合并到源/开发。将 origin/develop 合并到 origin/master 时,我遇到了我删除的四个文件之一
我使用 Azure 表存储从 MVC 应用程序记录访问者信息,但有时会引发以下异常: [WebException: The remote server returned an error: (409)
我有一张 table : create table c ( e text not null, m text not null, p numeric not null,
我是一名优秀的程序员,十分优秀!