Angular 2 component input without value

Discussão em 'Angular' iniciado por AlanObject, Dezembro 12, 2024.

  1. AlanObject

    AlanObject Guest

    I want to create a component that has attributes that need no value. For example, instead of something like this: (which I have now)

    <app-document [mode]="'edit'" ... ></app-document>


    or

    <app-document [editMode]="true" ... ></app-document>


    I would rather have:

    <app-document editMode ...></app-document>


    So the component itself has to see whether the attribute editMode is present or not. This will look a lot cleaner when I have a lot of such attributes. I haven't seen any documentation on how to do this. Is it doable?

    Continue reading...

Compartilhe esta Página