Problem with Migration from Angular JS to Angular
udayannayak opened this issue · 4 comments
Hello,
I have followed following steps to migrate my angular js(1.6.7) project to angular (7).
- Converted Angular js controller to components
- Converted to all files to typescript
- Installed ngUpgrade module.
- Bootstraped component as described in https://angular.io/guide/upgrade
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { UpgradeModule } from '@angular/upgrade/static';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
@NgModule({
imports: [
BrowserModule,
UpgradeModule
]
})
export class AppModule {
constructor(private upgrade: UpgradeModule) { }
ngDoBootstrap() {
this.upgrade.bootstrap(document.body, ['app'], { strictDi: true });
}
}
We are using gulpfile to generate output and it combines code in one file.
After all these steps i am facing following errors:
Please help me with this. Let me know if i am missing any steps.
If you could demonstrate this by doing the exact same steps in a sample app, such as the angularjs-phonecat sample and share that, I would be happy to debug and solve this issue with you!
I think that complexity is due to my project. My project is divided in to directives and we are using $scope in the directive. Can you please let me know can I use this existing directive without converting them to component in Angular project?
In the application that I have been upgrading, we have all the parts of the app re-written in the angularjs v1.5 style. We still have $scope in some of the components and everything seems to be working well. I don't really know if that would be causing this specific error though.
Like I said, if you can get a smaller sample app size project for me to look at, I would be more than willing to help debug.
Hello Brain,
Thanks for you help. I am able to convert my application by following steps as described here, https://www.softwarearchitekt.at/post/2017/07/14/directly-upgrading-from-angularjs-1-x-to-angular-by-skipping-preparation.aspx
I am closing the issue. Thanks for the help once again!