Home > Net >  Type 'Event' is missing the following properties from type 'CronOptions'
Type 'Event' is missing the following properties from type 'CronOptions'

Time:04-15

I want to use cron-editor in my angular form but getting this error in the terminal, enter image description here

 this.cronExpression = '4 3 2 12 1/1 ? *';
    this.cronOptions = {
      formInputClass: 'form-control cron-editor-input event',
      formSelectClass: 'form-control cron-editor-select',
      formRadioClass: 'cron-editor-radio',
      formCheckboxClass: 'cron-editor-checkbox',

      defaultTime: '10:00:00',
      use24HourTime: true,

      hideMinutesTab: true,
      hideHourlyTab: false,
      hideDailyTab: false,
      hideWeeklyTab: false,
      hideMonthlyTab: false,
      hideYearlyTab: false,
      hideAdvancedTab: true,

      hideSeconds: false,
      removeSeconds: false,
      removeYears: false

These are the cron Options i was using.

the error i am getting in my terminal

Type 'Event' is missing the following properties from type 'CronOptions': formInputClass, formSelectClass, formRadioClass, formCheckboxClass, and 12 more.

CodePudding user response:

You need to remove the two way binding.

Options passed to a component are usually just inputs, not outputs.

There error states that : it does not recognize the CronOptions as an Event.

<cron-editor [cron]="cronExpression" [options]="cronOptions">
</cron-editor>

  • Related