angular - 如何更改角度自定义元素的网址
问题描述
我想更改 Angular 项目中自定义元素的 url,即当前项目正在使用 url http://localhost:4200/#/wb/(some-id)成功运行自定义元素。我的需要是将url改为http://localhost:4200/project,而不改变组件的路由配置。如何做到这一点?
index.html 文件
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Workbench</title><!-- Latest compiled and minified CSS -->
</head>
<body>
<app-root></app-root>
<work-bench></work-bench>
<script type="text/javascript" src="./workbench.js"></script>
<link rel="stylesheet" href="styles.css"></link>
</body>
</html>
解决方案
推荐阅读
- javascript - Socket.io 客户端无法连接到服务器
- excel - 如何使滚动条为我的颜色选择器着色?
- swift - Swift / Cocoa:如何观察文件夹的变化?
- python - 如何在张量流中水平翻转标记的方向
- unity3d - Unity 中的“文本缓冲区太大”错误
- django-allauth - Django allauth:在用户创建期间获取 IntegrityError
- python - Numpy:这段代码彼此有何不同?
- philips-hue - 实时从 Hue 获取数据
- postgresql - 将 Postgres 转储中的数据加载到 Docker Postgres 容器中的新数据库中
- testing - SoapUI 中的条件 XPath 表达式 - 如何比较存储在自定义属性中的两个值?