0

Suppose to have this home.component.html page:

other component
<app-modal [display]="displayModal"></app-modal>

Now In my home.component.ts I put like instance variable:

 @Output() displayModal='none';

In my app.module.ts do:

     declarations: [
        ...
        HomeComponent,
ModalComponent
        ....
      ],

And in my app-modal.component.ts I use in my instance variable:

 @Input() display;

But it gives me :

Can't bind to 'display' since it isn't a known property of 'app-modal'.

Anyone can help me?

Doflamingo19
  • 1,591
  • 4
  • 12
  • 32
  • Possible duplicate of [Angular2 dynamic change CSS property](https://stackoverflow.com/questions/33328347/angular2-dynamic-change-css-property) – Christian.K Oct 10 '18 at 13:21
  • 2
    @Christian.K - I don't see in the question that he is trying to set a style property. – ConnorsFan Oct 10 '18 at 13:23
  • @ConnorsFan Well, the OP is trying to set something called "display" to a value of "none". That sounds suspiciously like attempting to set the CSS property of the same name. I might be wrong, but nobody has to agree with the close request anyway. – Christian.K Oct 10 '18 at 13:25
  • 1
    This question is confusing. Please update it to clarify what it is you're trying to do and the expected result. – Reactgular Oct 10 '18 at 13:51
  • I just put your example into a stackblitz, and it seems to work. https://stackblitz.com/edit/angular-enxkvh Maybe you left out some other details that I missed? I am not sure why you need to decorate the `displayModal` property of the `HomeComponent`. I assume this is a simplified example of a more complex problem you are facing. – joshvito Oct 10 '18 at 13:54

0 Answers0