如何基于ngxPermissions启用/禁用p日历

时间:2018-12-31 11:20:17

标签: angular primeng-calendar

<p-calendar  id="editFFdate" [required]="true" [showIcon]="true" [(ngModel)]="editFFdate" name="editFFdate" [monthNavigator]="true" [yearNavigator]="true" yearRange="2000:2030" showButtonBar="true">
      </p-calendar>

如何使用* ngxPermissions使p日历仅对特定角色启用

1 个答案:

答案 0 :(得分:0)

您可以在ng-template中添加p-calendar,例如:

<div *ngxPermissionsOnly="['ADMIN', 'GUEST']">
  <p-calendar  id="editFFdate" [required]="true" [showIcon]="true" 
    [(ngModel)]="editFFdate" name="editFFdate" [monthNavigator]="true" 
     [yearNavigator]="true" yearRange="2000:2030" showButtonBar="true">
  </p-calendar>
</div>