Problems encountered using angularjs

Time:2021-12-2

Problem description

Error: [$injector:modulerr] Failed to instantiate module ngMock due to:
Error: [$injector:unpr] Unknown provider: $$rAFProvider

The error is shown in the figure

Problems encountered using angularjs


Error reason

ngmockVersion andangularjsVersion is inconsistent.
useyeomanWhen building tools, the latest is used by defaultangularjs。 However, the project requires compatibility to IE8, andangularjs 1.3.*And above versions have abandoned the support for IE8, so IangularjsThe version of was switched to 1.2.9. Because it is the first time to usegrunt, so I only changed itdependencied, but not modifieddevDependencied, which led to this error.

resolvent

Modify in the bower.json file. After modification, as shown in the figure:

Problems encountered using angularjs


Run the test again and find that everything is normal.

Problems encountered using angularjs