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

  • Expert Angular
  • Mathieu Nayrolles Rajesh Gunasundaram Sridhar Rao
  • 214字
  • 2021-07-15 17:05:37

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.
主站蜘蛛池模板: 汕头市| 弋阳县| 襄樊市| 叙永县| 扶沟县| 星座| 镇康县| 嘉鱼县| 武川县| 察雅县| 柳州市| 苏州市| 平罗县| 太康县| 邢台县| 湛江市| 宁城县| 青冈县| 格尔木市| 珠海市| 黄浦区| 瑞安市| 峡江县| 乡城县| 黄骅市| 漳浦县| 罗田县| 西昌市| 夏河县| 新河县| 滕州市| 金溪县| 罗定市| 新龙县| 四川省| 桐乡市| 绍兴县| 齐齐哈尔市| 恩平市| 东阿县| 龙泉市|