ICommand interface not available in Angular ^5.20221.842

Posted by: seaninglis on 5 July 2022, 4:42 am EST

    • Post Options:
    • Link

    Posted 5 July 2022, 4:42 am EST

    I’m dynamically assigning to a WjMenu in Angular, and I have two issues.

    1. Assigning to the [command] property in the template generates a compilation error:
    error NG8002: Can't bind to 'command' since it 
    isn't a known property of 'wj-menu'.
    
    

    As a workaround, I programmatically assign to the wjMenu.command property when my component is initialised, and everything works as expected.

    1. I have to declare my command object as “any”, as “ICommand” doesn’t seem to be exported from the index for the input module:
    /**
     * Interface implemented by command objects.
     *
     * For details, please see the {@link Menu.command} property.
     */
    interface ICommand {
        /**
         * Executes the command with a given parameter.
         *
         * The parameter passed to the command is defined by the value of the
         * {@link Menu.commandParameterPath} property of the current item.
         * If the {@link Menu.commandParameterPath} property is not specified,
         * the parameter passed is the item itself.
         */
        executeCommand(parameter: any): void;
        /**
         * Returns true if the command can be executed in the current app state.
         *
         * If this method returns false, the corresponding menu option is
         * disabled.
         */
        canExecuteCommand?(parameter: any): boolean;
    }
    
    

    The signature is trivial to get right and it all hangs together, but is there some other way I should be referencing it or is it just an omission?

  • Posted 6 July 2022, 10:04 pm EST

    Hello,

    We apologize for the delayed response, both the issue seems like a bug therefore we have reported the issue to our Dev team for further investigation of the issue with an internal tracking ID WJM-24440. We will provide you an update on this as soon as we get any response.

    Meanwhile you can use the type anyfor the command property. Sorry for the inconvenience.

    Regards

  • Posted 7 July 2022, 9:25 am EST

    Hi,

    I just added my own identical ICommand interface and use that with a note if it becomes available at some future point.

    Thanks

    Sean

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels