Skip to content

Commit 6da9154

Browse files
committed
Fix navigation property return type in model code generation
1 parent d634991 commit 6da9154

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

  • projects/angular-odata/schematics/apigen/angular

projects/angular-odata/schematics/apigen/angular/model.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ export class ModelField {
7272
if (this.edmType instanceof CsdlNavigationProperty) {
7373
const entity = pkg.findEntity(this.edmType.Type);
7474
return ` public ${getterName}() {
75-
return this.getAttribute<${entity?.importedName(imports)}>('${this.edmType.Name}') as ${entity?.importedName(imports)};
75+
return this.getAttribute<${entity?.importedName(imports)}>('${this.edmType.Name}') as ${this.type(imports)};
7676
}
7777
`;
7878
} else {
@@ -103,7 +103,7 @@ export class ModelField {
103103
if (this.edmType instanceof CsdlNavigationProperty) {
104104
const entity = pkg.findEntity(this.edmType.Type);
105105
return ` public ${fetchName}(options?: ODataQueryArgumentsOptions<${entity?.importedName(imports)}>) {
106-
return this.fetchAttribute<${entity?.importedName(imports)}>('${this.edmType.Name}', options) as Observable<${entity?.importedName(imports)}>;
106+
return this.fetchAttribute<${entity?.importedName(imports)}>('${this.edmType.Name}', options) as Observable<${this.type(imports)}>;
107107
}
108108
`;
109109
} else {

0 commit comments

Comments
 (0)