官术网_书友最值得收藏!

Rules for incremental upgrade to Angular

It will be easier to do an incremental upgrade if we adhere to the following set of rules:

  • Implement one component per file; it helps to isolate the components and migrate them one by one.
  • Apply modular programming and arrange the folder by features; this will enable the developers to concentrate on migrating one feature at a time.
  • Use a module loader; following the preceding rules, you will end up with a large number of files in a project. This creates the hassle of organizing the files and referring them in the correct order in the HTML pages. When you use a module loader such as SystemJS, Webpack, or Browserify, it enables us to use TypeScript built-in module systems. This enables the developers to import or export features explicitly and share them between various parts of the application in the code.
  • Install TypeScript first; it is good to bring in the TypeScript compiler before starting the actual upgrade process. This can be achieved by a simple step of installing the TypeScript compiler.
  • Use Component Directives; it is good practice to use Component Directives rather than ng-controller and ng-include in the AngularJS apps so that in Angular, migrating the Component Directives will be much easier than migrating the controllers.
主站蜘蛛池模板: 上栗县| 冷水江市| 商都县| 襄汾县| 迁西县| 姚安县| 郑州市| 龙岩市| 开化县| 保德县| 泗水县| 晋中市| 仁化县| 梅河口市| 仁寿县| 明水县| 民权县| 墨江| 安远县| 特克斯县| 通山县| 房产| 四平市| 新昌县| 长沙县| 兴宁市| 凯里市| 城步| 阿尔山市| 塔城市| 扬州市| 江阴市| 吉安县| 磐石市| 金昌市| 广安市| 驻马店市| 道孚县| 随州市| 海宁市| 正定县|