isaacplmann / ngx-contextmenu

An Angular component to show a context menu on an arbitrary component
MIT License
248 stars 91 forks source link

Using computed attributes on ng-template #160

Open daddyschmack opened 5 years ago

daddyschmack commented 5 years ago

Hi Isaac, I'm trying to write unit tests around your example of using computed attributes in the templateRef. I don't see any unit tests in this repo. But the native property doesn't support that. How are you getting access to those properties? Are they being inherited? Are you doing some other kind of magic? error: Can't bind to 'visible' since it isn't a known property of 'ng-template'. api reference: https://angular.io/api/core/TemplateRef#properties code:

 <ng-template contextMenuItem let-item
                 (execute)="downloadStaject($event.item.stajects[$event.item.stajectIndex], $event.item.stackId)"
                 [visible]="canDownloadStaject">
        <fa-icon [icon]="['fas', 'download']"></fa-icon>
        Download
    </ng-template>
isaacplmann commented 5 years ago

[visible] is not a property of .  It’s an Input for the contextMenuItem directive.  That directive needs to be available in whatever module you’re using. On May 20, 2019, 6:47 PM -0400, daddyschmack notifications@github.com, wrote:

Hi Isaac, I'm trying to write unit tests around your example of using computed attributes in the templateRef. I don't see any unit tests in this repo. But the native property doesn't support that. How are you getting access to those properties? Are they being inherited? Are you doing some other kind of magic? error: Can't bind to 'visible' since it isn't a known property of 'ng-template'. api reference: https://angular.io/api/core/TemplateRef#properties code: <ng-template contextMenuItem let-item (execute)="downloadStaject($event.item.stajects[$event.item.stajectIndex], $event.item.stackId)" [visible]="canDownloadStaject"> <fa-icon [icon]="['fas', 'download']"> Download — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.