[英]Restore Angular 4 project from dist folder
So I accidentally deleted my Angular 4 project but I still have dist folder with all bundles and code packed. 所以我不小心删除了我的Angular 4项目,但我仍然有所有包和代码打包的dist文件夹。 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. 如果您没有项目文件,则无法对Angular应用程序进行反向工程以获取源代码。 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.
如果它与Angular的视图引擎(如果你一直在开发最佳实践时不应该这样)并没有过多的关联,那么你可以看看已编译的代码以获得一些业务逻辑,并尝试恢复它。
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. 这就像尝试从只有5回到2 + 3.你不知道它是3 + 2,1 + 4,4 + 1.Angular编译你的应用程序,并没有1-1映射。 Especially when you consider that you've also been using TypeScript.
特别是当你考虑到你也一直在使用TypeScript时。 Angular's build output it two compilers and a bundler away from original.
Angular的构建输出两个编译器和一个远离原始的捆绑器。 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). 在Dist文件夹中部署应用程序代码,然后使用Google Chrome Developer工具(F12)。 Under debugger tab, look under webpack -> src It will show all typescript files.
在调试器选项卡下,查看webpack - > src它将显示所有打字稿文件。 you can copy and past the code provided.
您可以复制并通过提供的代码。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.