Utilizing a TypeScript class that I created called Budget
to initialize data for a module has been proving to be challenging.
When I attempt something like this:
currBudget: {} = { id: 20, name: 'Chris' };
everything functions as expected. However, when I try:
currBudget: Budget;
where the Budget
class is imported into the component and contains the same fields declared with default values, the data does not become accessible.
Could there be some unconventional syntax in TypeScript causing this issue? Should I declare Budget
as an interface instead?