My client project heavily utilizes TypeScript. Currently, I am encountering a technical issue.
Within my HTML code, I have an anchor tag as shown below:
<a class="btn btn-default mrm" ui-sref="course-detail({courseId: '{{c.Id}}'})">Details</a>
In my course detail controller, I am retrieving the values in the stateparam variable. However, when attempting to access the 'courseId' from that variable, a build error occurs. Please refer to the image below for clarification.
https://i.sstatic.net/PNpcD.png
If I remove the IF block, I can successfully log the output in the developer console as displayed in the image below.
https://i.sstatic.net/0bZud.png
Obtaining the course Id property and value is crucial for the continuation of my project. Otherwise, I may be forced to rewrite this controller using pure AngularJS, which is not my preferred approach. Thank you.