1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Anuncie Aqui
    Anuncie aqui você Também: fdantas@4each.com.br

Why passing element: { type: string, name: string, content: string }; doesn't work?

Discussão em 'Angular' iniciado por Malik Usama, Setembro 30, 2024.

  1. Malik Usama

    Malik Usama Guest

    I am trying the access element But it's showing an error


    Property 'element' has no initializer
    ​

    import { Component, OnInit, Input } from '@angular/core';

    @Component({
    selector: 'app-server-element',
    templateUrl: './server-element.component.html',
    styleUrls: ['./server-element.component.css']
    })
    export class ServerElementComponent implements OnInit {
    @Input('srvElement') element: {type: string, name: string, content: string}; <--- This doesn't work

    constructor() { }

    ngOnInit() { }

    }

    Continue reading...

Compartilhe esta Página