Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angular/33.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Angular 对特定路由器链路和所有子路由使用*ngIf=_Angular_Routes_Wildcard_Router - Fatal编程技术网

Angular 对特定路由器链路和所有子路由使用*ngIf=

Angular 对特定路由器链路和所有子路由使用*ngIf=,angular,routes,wildcard,router,Angular,Routes,Wildcard,Router,问题:在父路由的所有子路由中显示[content],即。[content]以使./parent/child1、./parent/child2、./parent/child2(n)全部显示[content] 建议的解决方案:[content]或变体[content],似乎不被角度框架所接受 文件: 基于将Fiehra的答案作为建议的解决方案:使用*ngIf=“router.url.includes('/parent/)来划分引用父路由的子路由。解决了我的问题 您是否尝试过完美的解决方案。谢谢。

问题:在父路由的所有子路由中显示[content],即。
[content]
以使./parent/child1、./parent/child2、./parent/child2(n)全部显示[content]

建议的解决方案:
[content]
或变体
[content]
,似乎不被角度框架所接受

文件:


基于

将Fiehra的答案作为建议的解决方案:使用*ngIf=“router.url.includes('/parent/)来划分引用父路由的子路由。解决了我的问题


您是否尝试过完美的解决方案。谢谢。