Questions tagged [ng-upgrade]

Using the `upgrade` module in Angular to incrementally upgrade an AngularJS application to Angular.

157 questions
4
votes
0 answers

Angular 4 AOT compilation in hybrid app

Currently, I'm working on upgrading an AngularJS app to Angular 4, using the upgrade module. With our current webpack config, it works fine, both in development and production. When I added aot compilation through @ngtools/webpack, I got rid of all…
superMDguy
  • 95
  • 7
4
votes
2 answers

Using protractor with ng-upgrade

I am working on migrating my AngularJS (1.6) app to Angular (4) and now have a hybrid application, bootstrapped with NgUpgrade. However, this seems to have completely broken my Protractor tests. Failed: Timed out waiting for asynchronous Angular…
Matt Wilson
  • 8,159
  • 8
  • 33
  • 55
4
votes
1 answer

Using ng-annotate with angular cli

I have an existing angular.js application, which I am in the process of upgrading to angular with NgUpgrade. I am also trying to move to using angular cli as the build system. ng serve and ng build works perfectly, but I am having trouble with ng…
larlon
  • 557
  • 1
  • 6
  • 17
4
votes
0 answers

Are Angular2 components downgraded by ng-upgrade compiled by Angular 1 at runtime

I have used ng-upgrade to bootstrap our Angular1 application as a hybrid app. I have AOT compiling the Angular2 scripts which contains 1 dummy component at the minute. I have also bundled the additional files and am running Angular2 in production…
4
votes
1 answer

Unexpected token export - Angular 2

I am trying to import import { UpgradeComponent } from '@angular/upgrade/static'; for using angular1 directive in angular2 using ngupgrade but I am getting this error. Code: import { Directive, ElementRef, Injector } from '@angular/core'; import {…
Johnson Samuel
  • 2,046
  • 2
  • 18
  • 29
4
votes
1 answer

How to use angular 2's upgradeAdapter.upgradeNg1Component?

I'm pretty sure I'm missing something fundamental here. I started using the ng2 upgrade adapter before RC5 to start porting an ng1 application to ng2. And before, when you declared the directives a component was using directly on the component,…
snorkpete
  • 14,278
  • 3
  • 40
  • 57
4
votes
0 answers

Angular 2 ComponentRef unimplemented

I'm looking for a way to get the ComponentRef of a component in my angular1 and 2 hybrid app. Because I have to use the UpgradeAdapter bootstrap rather than the angular2 I don't get a promise with the ComponentRef to the root back from bootstrap…
Keith O
  • 85
  • 6
3
votes
1 answer

Error: Local workspace file ('angular.json') could not be found when upgraded to Angular 6

I have upgrading my project from Angular 5 to Angular 6. When I try to run the application using npm start it is throwing a below error. I know that there is already questions like this that has answers, but I tried the most of them and those…
Bhushan Khaladkar
  • 420
  • 1
  • 7
  • 20
3
votes
1 answer

ng update @angular/cli @angular/core or npx @angular/cli@13 update @angular/core@13 @angular/cli@13 is not working

I am trying to upgrade my angular cli and angular core from 12 to 13, but looks like there are peer dependency issues. did any one faced this issue ? npx @angular/cli@13 update @angular/core@13 @angular/cli@13 [![npm ERR! Could not resolve…
Ravikumar
  • 413
  • 1
  • 7
  • 18
3
votes
0 answers

Calling downgradeInjectable to use new Angular service in an AngularJS module throws TypeError

Attempting to use an Angular service in an Angular JS module in a hybrid application is giving one of two errors: Error: [$injector:unpr] Unknown provider: testServiceProvider <- testService - i.e. the service is registered too late for the…
Ash Clarke
  • 4,807
  • 1
  • 37
  • 48
3
votes
0 answers

In an angular hybrid app, how exactly does downgradeModule work in relation to the Angular zone?

I'm mainly interested in the impact of this line in their documentation: Unlike UpgradeModule, downgradeModule() does not bootstrap the main AngularJS module inside the Angular zone. Does this mean that just the initial bootstrap of the…
3
votes
1 answer

Error: [$injector:unpr] Unknown provider - while migrating AngularJS1 to Angular6

I'm trying to do upgrade components written in AngularJS1 to Angular6. I'm taking the approach of having the wrappers for all the existing AngularJS1 component by extending "UpgradeComponent" placed under the folder "directive-wrappers" in my…
Krishnan
  • 958
  • 5
  • 21
  • 44
3
votes
0 answers

Is there any alternative to UpgradeAdapter.registerForNg1Tests?

I have an Angular hybrid app which use UpgradeModule. The AngularJS components depend on Angular services downgraded by downgradeInjectable. When I unit test the components, I saw this error. Error: Error while instantiating injectable 'MyService':…
rch850
  • 710
  • 1
  • 5
  • 14
3
votes
1 answer

Upgrade angular 4 to 7 http to httpclient

Currently, I am upgrading my Angular project4 using webpack to Angular7. I stuck in one step Switch from HttpModule and the Http service to HttpClientModule and the HttpClient service. HttpClient simplifies the default ergonomics (You don't need…
Spring
  • 831
  • 1
  • 12
  • 42
3
votes
0 answers

Using services in Angular/AngularJS hybrid app (ng-upgrade)

Currently building a slimmed down version of the app for plunker so I can SHOW you my problem, but in case anyone has any tips off the top of their heads in the mean time, I will attempt to describe my problem first. I'm using ngUpgrade to start…
Thierry Blais
  • 2,848
  • 22
  • 41
1 2
3
10 11