Questions tagged [ng-upgrade]

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

157 questions
3
votes
1 answer

Angular 2+ services to angularJs

I m trying to convert Angular 2+ service and use it in angularJs project. app/users.service.ts import { Injectable } from '@angular/core'; @Injectable() export class UsersService { private users: any = [ { id: 1, name: 'john' }, …
3
votes
1 answer

Are there any alternatives to ngUpgrade for running angular and angularjs side-by-side, or a way to opt out of ngUpgrade's $digest triggers?

I have a rather large angular.js 1.6 app that I would like to migrate to Angular, but using ngUpgrade causes way too many $digests to be triggered (i.e. every time Zone.onMicrotaskEmpty is fired). Unfortunately the app I am migrating is already not…
David Deutsch
  • 17,443
  • 4
  • 47
  • 54
2
votes
1 answer

Downgraded Angular component with no change detection in AngularJS

For performace reasons I am using Angular's downgradeComponent, https://angular.io/api/upgrade/static/downgradeComponent. My Angular component: export class MyComponent { @Input() field: any; } Template: Angular value is…
lostintranslation
  • 23,756
  • 50
  • 159
  • 262
2
votes
1 answer

Cannot find namespace after updating to Angular 10

Everything was working on Angular 8, I started updating first to Angular v9, then to Angular v10, and when I tried to run my project, all namespaces were affected, I hope maybe there is a solution to this issue instead of moving everything to an…
Alex
  • 879
  • 2
  • 10
  • 20
2
votes
0 answers

Is there a standard way to get AngularJS to detect the initial values of an UpgradeComponent when it is loaded dynamically?

Background info: There is a fairly common problem that was previously brought up in this github issue about an injector error when using UpgradeComponents inside of dynamically loaded entry components. I feel that I understand this well enough, and…
2
votes
1 answer

Uncaught SyntaxError: Unexpected token ! in vendors.bundle.js 174

I have a project in angularjs that i want to upgrade. So i installed ng-upgrade and got it set up, but when i ran the program i got this error: Uncaught SyntaxError: Unexpected token ! vendors.bundle.js 174 I am new to webpack, what should i…
Nicholas
  • 41
  • 9
2
votes
0 answers

How to resolve a injectable constant while upgrading to angular 5 from angularjs 1.5

I recently started on implementing a hybrid app to upgrade our relatively large application from angularjs 1.5 to angular 5. The problem now is in our application.module.ts, angular.module has a config ".constant("appConfig", window.appConfig).…
Tom Lai
  • 21
  • 1
2
votes
1 answer

is it possible to run angularJS unit tests with angular-cli `ng test`?

I work on an AngularJS 1.6.X ES6 application. I use Mocha and Sinon to write and run unit tests on it. I started to hybrid/upgrade this application with ngUpgrade in order to write the new components in angular. So now, I got some angularJS modules…
Steph
  • 21
  • 4
2
votes
1 answer

3rd party Angular 4 control in hybrid app

I am trying to upgrade an AngularJS 1.5 app to Angular 4. I have successfully managed to bootstrap the application and have an Angular4 component loaded in an AngularJS component template. Now I am trying to use a 3rd party Angular4 tree component…
tangokhi
  • 945
  • 2
  • 8
  • 20
2
votes
1 answer

Change detection not working in downgraded Angular components

I'm in the process of converting a rather big application written in AngularJS to an Angular application using the @angular/upgrade module. For now, every component from AngularJS is running as expected in the Angular app. The app is being…
2
votes
0 answers

Error when importing UpgradeAdapter to upgrade to Angular 4 (import declaration can only be used in a namespace or module)

I'm starting to upgrade an AngularJS app to Angular 4, and I'm trying to bootstrap it using the upgrade adapter like this in the ('entry' file for the app) - where the function is within a closure, in an independent app.ts file : app.ts (was…
Chris Halcrow
  • 28,994
  • 18
  • 176
  • 206
2
votes
0 answers

Using Angular UpgradeComponent

I'm trying to use UpgradeComponent in order to use Angular 1 library (ui-grid) in my Angular 4 application. My steps: Create a new directive: import { Directive, ElementRef, Injector, Input, OnInit, SimpleChanges, OnChanges, DoCheck, OnDestroy,…
TheUnreal
  • 23,434
  • 46
  • 157
  • 277
2
votes
0 answers

Error: No component factory found for undefined. Did you add it to @NgModule.entryComponents?

I'm attempting to share a custom angularjs service with an angular component using UpgradeModule and am following the pattern in the Angular documentation. I am including the path to my "working" plunker code. I have commneted out the code that…
J.Decker
  • 21
  • 2
2
votes
1 answer

Angular 2+ can't find Angular 1.X to bootstrap

I'm trying to bootstrap an Angular 1.X app with Angular 2+ (Angular 4.1.0 at the time of writing this question). I followed the online guide to the T but can't seem to make headway. I'm using a hybrid of ES2015+ (compiled via Babel) and TypeScript.…
antjanus
  • 987
  • 3
  • 15
  • 30
2
votes
0 answers

How to run Angular-scenario runner tests with Angular1/2 hybrid app?

We have a big Angular 1.4 application. Our equally big set of E2E tests are written using Angular Scenario Runner (Yes, I know we should have used Protractor). Now, we are trying to transition to Angular2, going through the ngUpgrade hybrid…
ashish
  • 750
  • 5
  • 12