Code Monkey home page Code Monkey logo

Comments (6)

gnbabu avatar gnbabu commented on August 28, 2024

i have updated the @uirouter/angular-hybrid configuration used. I am able to run the application successfull after migration, but when I run the unit test i am getting the issue then all the tests are failing.
Hi @christopherthielen if you have any idea could you please help me

from angular-hybrid.

christopherthielen avatar christopherthielen commented on August 28, 2024

I think this is an ngUpgrade problem. angular-hybrid calls angular.module when it gets loaded, but angular isn't loaded yet in your tests.

Try this workaround:
angular/angular#16484

from angular-hybrid.

gnbabu avatar gnbabu commented on August 28, 2024

Thank you @christopherthielen . I have already using setAngularJSGlobal to register angular in main.ts

import angular from 'angular';
setAngularJSGlobal(angular);

from angular-hybrid.

gnbabu avatar gnbabu commented on August 28, 2024

@christopherthielen any other suggestions you can give about this issue.

from angular-hybrid.

christopherthielen avatar christopherthielen commented on August 28, 2024

@gnbabu make sure you load angularjs before anything else. This message is coming from angular/upgrade/static and indicates that angularjs is being used before it has been loaded. angular/upgrade/static is being used by uirouter-hybrid when uirouter-hybrid gets loaded.

That's about all I can gather from your problem description.

Perhaps this article will help explain it better: https://blog.nrwl.io/ngupgrade-in-depth-436a52298a00

from angular-hybrid.

gnbabu avatar gnbabu commented on August 28, 2024

Issue got fixed
This issue is coming because of the paths of the services imports. We have imported service directly from the paths like bellow

import{ WorkPermitsService } from '../../work-permits/work-permits.service';

After upgrading to angular 9 imported paths are not resolved when I run the unit tests. So i have exported it in services index.ts and importing from @services (common place for exporting) where ever required. like this i have done for all.

Change :
export { WorkPermitsService } from '../../work-permits/work-permits.service';

Importing in required places
import { WorkPermitsService} from '@services';

from angular-hybrid.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.