Angular 5 - Meta description not working

Discussão em 'Angular' iniciado por akididou, Julho 1, 2025.

  1. akididou

    akididou Guest

    I got a problem with the Meta function of Angular.


    import {Meta} from '@angular/platform-browser';
    ​

    I have added it on my page "contact.component.ts" but I'm not seeing anything on my web page. There is no meta description or something else.

    This is my page code:

    import {Meta} from '@angular/platform-browser';


    @Component({
    selector: 'app-contact',
    templateUrl: './contact.component.html',
    providers: [],
    styleUrls: ['contact.component.css']
    })

    export class ContactComponent implements OnInit {

    constructor(public meta: Meta, public http: Http, public router: Router, public RequestService: RequestService, public global: GlobalService) {
    this.meta.addTag({ name: 'description', content: 'This is metadata' });
    }

    ngOnInit() {
    this.global.redirectionIfNoConnecte();
    this.global.getJsonLanguage();
    }

    }


    Can you save me ? :(

    Continue reading...

Compartilhe esta Página