When I develop an Angular 2 app in Typescript it compiles to Javascript files. The errors in the browser point to a line number in the .js files e.g.:
TypeError: Phone.query2 is not a function phone_list.controller.js:5:27)
However what I want is a pointer to the line in the actual .ts file.
The corresponding sourcemap files are in place and the generated .js files point to the mapfiles e.g.:
//# sourceMappingURL=phone_list.controller.js.map
I have tried debugging in Firefox, Chrome and Webstorm.
Update
To reproduce follow these steps:
git clone https://github.com/johnpapa/angular2-tour-of-heroes
install the npm packages
npm i
In dashboard.component.ts add these two lines:
var test:any = null;
console.log(test.length);
This should cause throwing an error.
Run the project with npm start
In the console Chrome shows:
TypeError: Cannot read property 'length' of null
at DashboardComponent.ngOnInit (http://localhost:3000/app/dashboard.component.js:34:37)
Which points to .js files instead of the .ts files