Skip to content

Commit 06f1047

Browse files
committed
Fix options lookup for non-structured types
1 parent ae52e8b commit 06f1047

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

projects/angular-odata/src/lib/models/options.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -414,6 +414,10 @@ export class ODataModelField<F> {
414414
return this.parser.isEnumType();
415415
}
416416

417+
isEdmType() {
418+
return this.parser.isEdmType();
419+
}
420+
417421
enumType() {
418422
const enumType = this.enumForType ? this.enumForType(this.type) : undefined;
419423
//Throw error if not found
@@ -1102,7 +1106,7 @@ export class ODataModelOptions<T> {
11021106
.find((field: ODataModelField<any>) => field.field === name);
11031107
if (field !== undefined) {
11041108
v = Types.isPlainObject(v) || ODataModelOptions.isModel(v) ? v[field.name] : v;
1105-
options = this.api.optionsForType(field.type);
1109+
options = field.isStructuredType() ? this.api.optionsForType(field.type) : undefined;
11061110
}
11071111
}
11081112
if (field === undefined) return undefined;

0 commit comments

Comments
 (0)