简体   繁体   中英

My current project is build using Angularjs and i want to add new things in angular 7 in the same existing project. How can i do that

I am working on a project which is built using AngularJS and I want to add new things in the same project using Angular 7 . So that whatever the new module gets added in the project it should be built using Angular 7 . How can I do that? Please help me.

This can be done via ngUpgrade module, which allows you to downgrade Angular components, services and use it in AngularJS. Follow the official guide.

Here is an example of how you can downgrade Angular component:

import { downgradeComponent } from '@angular/upgrade/static';

angular.module('heroApp', [])
  .directive(
    'heroDetail',
    downgradeComponent({ component: HeroDetailComponent }) as angular.IDirectiveFactory
  );

Now you can use heroDetail in your existing AngularJS project.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM