jQWidgets Forums
jQuery UI Widgets › Forums › Form › Object literal may only specify known properties, and 'text' does not exist…
Tagged: angular 7 form, Angular form
This topic contains 5 replies, has 6 voices, and was last updated by tim.bird 6 years, 2 months ago.
-
Author
-
February 8, 2019 at 12:04 pm Object literal may only specify known properties, and 'text' does not exist… #103902
Try to put Button in jqxForm in Angular 7 component. The code is the same of the demo:
.... columns: Array<jqwidgets.FormTemplateItem> = [ { type: 'button', text: 'Sign up', width: '90px', columnWidth: '50%', align: 'right' }, ....
I’ve got this error in the compilation process:
error TS2322: Type ‘{ type: string; text: string; width: string; columnWidth: string; align: string; }’ is not assignable to type ‘FormTemplateItem’.
Object literal may only specify known properties, and ‘text’ does not exist in type ‘FormTemplateItem’.Then all seems to works, but can you help me to remove this message?
Thanks
MarcoFebruary 11, 2019 at 8:27 am Object literal may only specify known properties, and 'text' does not exist… #103917Hello Marco,
Could you clarify how to reproduce it?
Is this happens in a production build?Best Regards,
Hristo HristovjQWidgets team
https://www.jqwidgets.comFebruary 26, 2019 at 12:55 pm Object literal may only specify known properties, and 'text' does not exist… #104135Hi,
I am also having the same issue while adding button in jqxForm.
Thanks And Regards,
PrakashMarch 3, 2019 at 7:15 am Object literal may only specify known properties, and 'text' does not exist… #104200Hi Prakash,
Could you share stackblitz sample of that angular form related issue? This will help us to see the specific code.
Thanks in advance.
March 12, 2019 at 2:17 pm Object literal may only specify known properties, and 'text' does not exist… #104313The interface definition of jqwidgets.FormTemplateItem does not have an entry for a number of things that it should it seems.
In 7.1.0 this is the definition.export interface FormTemplateItem {
// FormTemplateItem properties
type?: string;
bind?: string;
submit?: boolean;
required?: boolean;
requiredPosition?: string;
info?: string;
infoPosition?: string;
component?: string;
init?: (value: any) => void;
label?: string;
labelPosition?: string;
labelAlign?: string;
align?: string;
valign?: string;
labelValign?: string;
height?: number | string;
rowHeight?: number | string;
width?: number | string;
columnWidth?: number | string;
labelWidth?: number | string;
labelHeight?: number | string;
padding?: FormPadding;
labelPadding?: FormPadding;
columns?: Array<FormTemplateItem>;
optionsLayout?: string;
options?: Array<any>;
}// FormTemplateItemThere is no entry for text?: or for name?: and yet examples use these. Angular 7 with jqwidgets fails to compile because of this.
March 12, 2019 at 3:46 pm Object literal may only specify known properties, and 'text' does not exist… #104315You can get the error to go away by editing the jqwidgets.d.ts file and adding text?: string to the export interface FormTemplateItem code
-
AuthorPosts
You must be logged in to reply to this topic.