fulls1z3 / ngx-meta

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

meta doesn't get updated. #186

Closed IzioDev closed 6 years ago

IzioDev commented 6 years ago
[ ] Regression (a behavior that used to work and stopped working in a new release)
[ x ] 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 -->
[ ] Feature request
[ ] Documentation issue or request

Current behavior I'm using ngx-core and ngx-meta, setted up like this:

import { MetaModule, MetaLoader, MetaStaticLoader, PageTitlePositioning } from '@ngx-meta/core';
const appRoutes: Routes = [
{
    path: 'about',
    component: AboutComponent,
    data: {
      meta: {
        title: 'Présentation',
        description: 'Venez en savoir plus sur nous, ce que nous apportons au RolePlay!'
      }
    }
  }
export function metaFactory(): MetaLoader {
  return new MetaStaticLoader({
    pageTitlePositioning: PageTitlePositioning.PrependPageTitle,
    pageTitleSeparator: ' - ',
    applicationName: 'PineappleV',
    defaults: {
      title: 'Serveur GTA RP (FiveM)',
      description: "Le meilleur éditeur d'expérience de jeu sur FiveM! PineappleV saura vous satisfaire durant tout votre GamePlay afin de vous apporter un divertissement incomparable! Un GTA RP comme jamais vu, rejoignez-nous",
      'og:image': 'http://localhost:4200/assets/images/logopineapple.png',
      'og:type': 'website',
      'og:locale': 'fr_FR',
      'og:locale:alternate': 'fr_FR'
    }
  });
}
imports: [
RouterModule.forRoot(
      appRoutes,
      { enableTracing: false }
    ),
    MetaModule.forRoot({
      provide: MetaLoader,
      useFactory: (metaFactory)
    })
  ]
})

The issue is... Nothing happend, even the default part! 👎 Expected/desired behavior If it's possible to explain why this is not working :/

Minimal reproduction of the problem with instructions Copy-past my code.

Environment