AngularJS 1.4-> Angular 9迁移 [英] AngularJS 1.4 --> Angular 9 migration

查看:122
本文介绍了AngularJS 1.4-> Angular 9迁移的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

由于AngularJS 1.4中已开发了大型应用程序,因此我决定对其进行完全重写.我转移了大部分HTML和CSS文件,现在可以创建TypeScript文件了.

I have decided to do a complete rewrite of the large scale application that I am working on since it is in AngularJS 1.4. I transferred over most of my HTML and CSS files and am now ready to create the TypeScript files.

我是否需要为1.4版本中的每个JavaScript文件创建一个TypeScript文件,否则是否会有更少的TypeScript文件?最初,我假设我需要与JavaScript相同数量的TypeScript文件.但是在研究之后,我发现很多地方都说使应用程序的每一页都是一个组件".因此,这使我想到,如果我的应用程序上总共有5个页面,那么我只需要5个TypeScript文件.原始文件包含约80个JavaScript文件.

Do I need to create a TypeScript file for every JavaScript file that is in the 1.4 version, or will there be fewer TypeScript files? At first, I assumed I would need the same amount of TypeScript files as there are JavaScript. But after researching it I find a lot of places that say "Make each page of your application one component". So this makes me think if I have 5 total pages on my application then I will only need 5 total TypeScript files. The original contains ~80 JavaScript files.

推荐答案

您的计划被称为大爆炸重写",这很常见,而且是个坏主意.

Your plan is called the "big bang rewrite", it's very common, and it's a bad idea.

在大多数情况下,大爆炸方法才是有根据的.

In most cases, it’s the Big Bang approach that wins the argument.

但是,通过发行Big Bang,您可以最大程度地提高完成进度时落后于进度的机会,因此,您可以最大限度地利用您没有足够时间准备的机会.这给您和您的客户都带来了糟糕的时光.

But by making it a Big Bang release, you’ve maximized the chances that you’ll be behind schedule when you get to the end, and you’ve therefore maximized the chances that you won’t spend enough time preparing. This results in a bad time for both you and your customers.

不幸的是,也许是由于人性的内在原因,这种情况对于大重写"项目来说是陈词滥调.

Unfortunately, perhaps due to something intrinsic in human nature, this scenario is a cliche for Big Rewrite projects.

-乍得·福勒:大爆炸

成功升级的关键之一是通过在同一应用程序中并排运行两个框架,并将AngularJS组件一个接一个地移植到Angular,来逐步进行升级.这使升级甚至大型和复杂的应用程序成为可能,而不会中断其他业务,因为该工作可以协同完成并分散在一段时间内. Angular中的upgrade模块旨在实现无缝的增量升级.

One of the keys to a successful upgrade is to do it incrementally, by running the two frameworks side by side in the same application, and porting AngularJS components to Angular one by one. This makes it possible to upgrade even large and complex applications without disrupting other business, because the work can be done collaboratively and spread over a period of time. The upgrade module in Angular has been designed to make incremental upgrading seamless.

有关更多信息,请参见

  • Angular Developer Guide - Upgrading from AngularJS
  • Migrating AngularJS to Angular 4,5 (with DEMO)
  • Running Angular and AngularJS frameworks side by side
  • AngularJS Developer Guide - Component-based application architecture
  • AngularJS 1.5+ Components do not support Watchers, what is the work around?

这篇关于AngularJS 1.4-> Angular 9迁移的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆