Chuyển đến nội dung
Skillpedia
Lập trình chung48k · #3746

angular-migration

Skill này làm gì

Công cụ này giúp cập nhật code từ hệ thống cũ AngularJS sang hệ thống mới là Angular. Nó hướng dẫn bạn thực hiện các thay đổi cần thiết ở các phần của ứng dụng, như component và cách chúng giao tiếp với nhau.

Khi nào nên dùng

  • ✓Khi bạn có một dự án xây dựng bằng AngularJS và muốn nâng cấp lên Angular.
  • ✓Khi cần làm cho website chạy được với cả phiên bản Angular cũ và mới cùng lúc.
  • ✓Khi chuyển các phần cũ của code (directive) thành các phần hiện đại (component).

Liên kết skill

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/angular-migration/SKILL.md

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/angular-migration/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Làm thế nào để di chuyển ứng dụng của tôi từ AngularJS sang Angular?”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Công cụ phân tích code cũ của bạn và gợi ý cách viết lại một số phần cho hệ thống mới. Nó có thể giúp thiết lập chế độ “hybrid”, nơi cả hai hệ thống cùng hoạt động trong giai đoạn chuyển đổi.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

Supporting material availability

This catalog copy contains the inline guidance below, but does not include the following supporting paths. They are external prerequisites, not bundled files:

  • <support-root>/references/hybrid-mode.md
  • <support-root>/references/component-migration.md
  • <support-root>/references/dependency-injection.md
  • <support-root>/references/routing.md
  • <support-root>/assets/hybrid-bootstrap.ts
  • <support-root>/assets/migration-timeline.md
  • <support-root>/scripts/analyze-angular-app.sh

Ask for the original supporting material or an existing installation before using a step that depends on these paths; this catalog does not identify a verified download source for them. Resolve each path relative to that installation, inspect its contents, and verify any applicable license and execution prerequisites. Do not run a command or claim a referenced procedure was followed until its required file exists. Do not fabricate the missing scripts or treat an unrelated file with the same name as equivalent. Independent steps fully documented here can proceed within the user’s authorized scope; report any dependent step as unavailable.

Angular Migration

Master AngularJS to Angular migration, including hybrid apps, component conversion, dependency injection changes, and routing migration.

Use this skill when

  • Migrating AngularJS (1.x) applications to Angular (2+)
  • Running hybrid AngularJS/Angular applications
  • Converting directives to components
  • Modernizing dependency injection
  • Migrating routing systems
  • Updating to latest Angular versions
  • Implementing Angular best practices

Do not use this skill when

  • You are not migrating from AngularJS to Angular
  • The app is already on a modern Angular version
  • You need only a small UI fix without framework changes

Instructions

  1. Assess the AngularJS codebase, dependencies, and migration risks.
  2. Choose a migration strategy (hybrid vs rewrite) and define milestones.
  3. Set up ngUpgrade and migrate modules, components, and routing.
  4. Validate with tests and plan a safe cutover.

Safety

  • Avoid big-bang cutovers without rollback and staging validation.
  • Keep hybrid compatibility testing during incremental migration.

Migration Strategies

1. Big Bang (Complete Rewrite)

  • Rewrite entire app in Angular
  • Parallel development
  • Switch over at once
  • Best for: Small apps, green field projects

2. Incremental (Hybrid Approach)

  • Run AngularJS and Angular side-by-side
  • Migrate feature by feature
  • ngUpgrade for interop
  • Best for: Large apps, continuous delivery

3. Vertical Slice

  • Migrate one feature completely
  • New features in Angular, maintain old in AngularJS
  • Gradually replace
  • Best for: Medium apps, distinct features

Hybrid App Setup

// main.ts - Bootstrap hybrid app
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { UpgradeModule } from '@angular/upgrade/static';
import { AppModule } from './app/app.module';

platformBrowserDynamic()
  .bootstrapModule(AppModule)
  .then(platformRef => {
    const upgrade = platformRef.injector.get(UpgradeModule);
    // Bootstrap AngularJS
    upgrade.bootstrap(document.body, ['myAngularJSApp'], { strictDi: true });
  });
// app.module.ts
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { UpgradeModule } from '@angular/upgrade/static';

@NgModule({
  imports: [
    BrowserModule,
    UpgradeModule
  ]
})
export class AppModule {
  constructor(private upgrade: UpgradeModule) {}

  ngDoBootstrap() {
    // Bootstrapped manually in main.ts
  }
}

Component Migration

AngularJS Controller → Angular Component

// Before: AngularJS controller
angular.module('myApp').controller('UserController', function($scope, UserService) {
  $scope.user = {};

  $scope.loadUser = function(id) {
    UserService.getUser(id).then(function(user) {
      $scope.user = user;
    });
  };

  $scope.saveUser = function() {
    UserService.saveUser($scope.user);
  };
});
// After: Angular component
import { Component, OnInit } from '@angular/core';
import { UserService } from './user.service';

@Component({
  selector: 'app-user',
  template: `
    <div>
      <h2>{{ user.name }}</h2>
      <button (click)="saveUser()">Save</button>
    </div>
  `
})
export class UserComponent implements OnInit {

…
Câu hỏi thường gặp

AngularJS và Angular là gì?

AngularJS là phiên bản cũ của một framework để xây dựng website, còn Angular là phiên bản mới, hiện đại hơn.

Ứng dụng “hybrid” là gì?

Đó là ứng dụng dùng cả hệ thống cũ (AngularJS) và mới (Angular) cùng lúc, cho phép chuyển đổi dần dần.

“Components” và “directives” là gì?

Directive là các khối xây dựng trong AngularJS, còn component là khối tương đương hiện đại hơn trong Angular.

Chi tiết

Mô tả gốc của tác giả

Master AngularJS to Angular migration, including hybrid apps, component conversion, dependency injection changes, and routing migration.

repo: sickn33/agentic-awesome-skills

Độ phổ biến

Sao GitHub
48k
Vị trí xếp hạng
#3746
Giấy phép
MIT
Cập nhật
15/10/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự