Reputation: 11
I'm working through a tutorial where a new Angular app is created with CLI then the ngUpgrade module is bootstapped and the old AngularJS code is copied in to run as a hybrid application.
Here is the tutorial: https://medium.com/@elenaorfe/migrate-angularjs-to-angular-through-angular-cli-hybrid-application-8790b272a1d7
I've followed it exactly, but get stuck on step 8.2 where I create the Angular service and try to downgrade it so that it is available to AngualrJS controllers in /src/app/core/phone/phone.service.ts. It compiles but has this error in the console:
Uncaught Error: [$injector:nomod] Module 'core.phone' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument.
https://errors.angularjs.org/1.8.3/$injector/nomod?p0=core.phone
The tutorial has code is available here: https://github.com/elenaorfe/angularjs-to-angular/tree/08-02-Upgrading_Services
I've also cloned this project and ran into the exact same issue, so I don't think I've made a mistake. Can anyone get this running or tell me what the issue is? Alternatively, does anyone have a working example of a hybrid Angular app using version 15.2.0 or newer? Everything that I have seen is much older and causes errors when running npm install.
Upvotes: 1
Views: 338