-
Notifications
You must be signed in to change notification settings - Fork 87
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: SEO friendly localized URLs for product detail pages (#110)
- moved ProductRoutePipe to core/routing/product - match incoming URLs for products with Angular UrlMatcher and RegExp pattern - improved typing of ProductRoutePipe
- Loading branch information
Showing
28 changed files
with
558 additions
and
142 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { Pipe, PipeTransform } from '@angular/core'; | ||
|
||
import { CategoryView } from 'ish-core/models/category-view/category-view.model'; | ||
import { ProductView } from 'ish-core/models/product-view/product-view.model'; | ||
import { generateProductUrl } from 'ish-core/routing/product/product.route'; | ||
|
||
@Pipe({ name: 'ishProductRoute', pure: true }) | ||
export class ProductRoutePipe implements PipeTransform { | ||
transform(product: ProductView, category?: CategoryView): string { | ||
return generateProductUrl(product, category); | ||
} | ||
} |
Oops, something went wrong.