Angular 7/1.x 混合应用程序可以支持 HMR 吗?

Can an Angular 7/1.x hybrid app support HMR?

我正在尝试使用 downgradeModule 策略在混合 angular 应用程序上实施 HMR,但它只是失败了。我从另一个问题来到这里 Can an Angular 5/1.x hybrid app support HMR? 因为没有公认的答案并且我认为 @scipper 的答案不起作用(下面的解释)。
我使用 HMR(添加了 new webpack.HotModuleReplacementPlugin()、添加了 devServer.hot:true 和其他东西)设置了 webpack 配置(不是 ng-cli,自定义配置),我可以看到它正在工作,我的入口文件正在重新加载,但没有整页使用新源重新加载并且 webpack 很好地应用了热更新,但是 angular 和 angularjs 应用程序不工作(使用旧的缓存代码)。
我的计划是:
1) 将模块热接受添加到入口文件.
2)销毁 angular.js 应用程序(如果存在)(使用 $rootScope destroy?).
3) 销毁 root angular.js app 节点,如果它存在的话。
4) 使用类似

的代码构建 angular 模块
// bootstrap you new Angular 7 main module
const bootstrapFn = (extraProviders) => {
  const platformRef = platformBrowserDynamic(extraProviders);
  return platformRef.bootstrapModule(MyAngularSevenModule);
};
const downgradedModule = downgradeModule(bootstrapFn);

5) 调用或重新调用 angularjs 模块和依赖项 + 我的 angular 模块 - 我认为这是我的主要问题。
6) bootstrap angularjs 应用程序(或 $compile + $digest)。

已经尝试过:
- https://github.com/PatrickJS/angular-hmr - 由于 downgradeModule 策略(根节点是 ajs)而不起作用。
- https://github.com/vitaliy-bobrov/angular-hot-loader - 由于未实现提供程序和其他拦截器而导致的很多错误。
- https://github.com/noppa/ng-hot-reload

我预计 bootstrap 将更新缓存的 angular 实体,但在 hmr 重新加载后 angular 使用旧的 controllers/components/directives(源选项卡中有新代码)。
有什么建议吗?

我在入口文件中设置错误,@scipper 是正确的,它正在运行。但是通过这种策略,我们正在重新加载整个应用程序(并丢失任何状态),我想找到仅重新启动已更改部分的解决方案。