I am currently developing an angular application where I am attempting to invoke a method from a child object within a repeater. The situation involves having a selected item with a company property. This company property contains a getAddressText() method that returns the address text for the company, which I want to display on the screen.
Here is the code snippet to provide context for my query. Upon testing the application, I noticed that ctrl.selectedItem.Company is being correctly accessed, but it seems to be disregarding the function call.
Below are the HTML and AngularJS code snippets:
<span>{{ctrl.selectedItem.Company.getAddressText()}}</span>
Typescript:
namespace app.controllers {
class MyController {
public selectedItem: app.models.Item;
}
}
namespace app.models {
export class Item {
public Company: Company;
constructor() {}
}
export class Company {
constructor() {}
getAddressText(): string {
return "Some text...";
}
}
}