Lesson

Testing Underscores

AngularJS injectors understand aliased for core injectables such as $rootScope in unit tests. If you surround your injected object with underscores $rootScope it will be understood and injected into your test by Angular. This allows you to use a local alias...

Duration
1 min
Access
Free
Transcript
Needs source

AngularJS injectors understand aliased for core injectables such as $rootScope in unit tests. If you surround your injected object with underscores _$rootScope_ it will be understood and injected into your test by Angular. This allows you to use a local alias of the same name.