本文介绍了从Angular 1背景来看Angular 2中的思考的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

让我们说我已经开始习惯使用角度1开发客户端SPA了,但现在我想对Angular 2进行更改。

Lets say I have become comfortable with developing client-side SPA's with angular 1 but now I want to make the change to Angular 2.

谁会是在进行更改时需要考虑的重要范例?

Who would be some of the important paradigms to take into consideration when making the change?

以下是一些可能有助于确定答案的问题:

Here are some questions that may help frame your answers:


  • Angular 2的建筑设计与1相比有什么主要区别?

  • 我应该停止/开始做什么?

推荐答案

架构设计的主要区别可能是单向数据流和对组件的关注。

Main difference in architectural design is probably the unidirectional data flow and the focus on components.

如果想要更简单的过渡,可以使用Typescript类作为控制器,开始使用 controllerAs 。开始学习 RxJS 的基础知识,Ng2就是基于它构建的。

Start using controllerAs with Typescript classes as your controllers if you want a more easy transition. Start learning the basics of RxJS, Ng2 is built on it.

这篇关于从Angular 1背景来看Angular 2中的思考的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-06 14:57