fulls1z3 / ngx-meta

Dynamic page title & meta tags utility for Angular (w/server-side rendering)
MIT License
333 stars 47 forks source link

Make configurable callback exceptions #189

Open rafa-suagu opened 5 years ago

rafa-suagu commented 5 years ago

I'm submitting a ... (check one with "x")

[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report  <!-- Please check the repository for a similar issue or PR before submitting -->
[ ] Support request => <!-- Please check the repository for a similar issue or PR before submitting -->
[x] Feature request
[ ] Documentation issue or request

Current behavior Currently only two metas has the "exception" status, 'og:locale' and 'og:locale:alternate'

Expected/desired behavior Configure the callback exceptions.

What is the motivation / use case for changing the behavior? It's impossible or undesired, suppose or predict the metas that the projects wants to exclude from callback function. In our case, we have for example 'og:type' or 'og:image' that doesn't need translation (thought the callback function). The workaround for this situation in our case it's the next:

callback: (key: string) => /^[^a-z\s]+$/.test(key) ? translateService.get(key) : key
rafa-suagu commented 5 years ago

If you accept this suggestion and a PR is needed or wanted, I can do it.

fulls1z3 commented 4 years ago

@rafa-as sorry for the delay, had busy times. feel free to fire a PR and i'll approve.