Вы буквально подразумеваете ссылку с текстом ссылки, который отличается от ее href, вот так ?
Если так,
<a [routerLink]="url">{{seoUrl}}</a>
Машинопись:
url: 'https://www.google.com';
seoUrl: 'https://www.google.com/category/slug';
Или вы хотите сделать что-то еще с URL самой страницы?
РЕДАКТИРОВАТЬ:
Модуль маршрутизации
// Declare two routes with an optional title. We will always redirect to the title route. Order matters here - routes will be matched in order.
{ path: 'category/:category/:title', component: CategoryComponent },
// this path declares a route similar to /category/abc where abc is a category
{ path: 'category/:category', component: CategoryComponent }
Компонент категории
// component decorator omitted for brevity
export class CategoryComponent implements OnInit {
constructor(private route: ActivatedRoute,
private router: Router
) {
}
ngOnInit(): void {
// get the category from the url
const categoryName = this.route.snapshot.paramMap.get('category');
const titleName = this.route.snapshot.paramMap.get('title');
// TODO: implement categoryService
this.categoryService.getCategory(categoryName).subscribe(category => {
if (!title) {
this.router.navigateByUrl(`/category/${category.name}/${category.title}`);
return;
}
// TODO: render the category
});
}
}