So I accidentally deleted my Angular 4 project but I still have dist folder with all bundles and code packed. So is there any way I can restore all the project layout so I can continue coding in my editor or is it gone forever? Thanks.
No.
If you do not have project files, you cannot reverse-engineer Angular application to get source back. You can take a peek at compiled code to get some business logic if it's not too tied with Angular's view engine (which it shouldn't be if you've been developing with best practices) and try restoring that, though.
It's like trying to go back to 2 + 3 from having only 5. You have no idea if it was 3 + 2, 1 + 4, 4 + 1. Angular compiles your application, and there's no 1-1 mapping. Especially when you consider that you've also been using TypeScript. Angular's build output it two compilers and a bundler away from original. Irreversible.
Here's a more detailed breakdown of how compilation looks like.
Deploy the app code in the Dist folder, and then use Google Chrome Developer tools (F12). Under debugger tab, look under webpack -> src It will show all typescript files. you can copy and past the code provided.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With