Thursday, January 21, 2016

Interview Questions on Angular JS

1. Ways of communction between modules of your application and their testing capabilities?

Ans: Services, Events, Between Controllers using ControllerAs, $parent, nextSibling, etc.,
         a. Services is easy to test, can be tested real or mocked services
         b. Events testing can be done by instatiatinig in unit controllers. $rootScope must be injected  to
              test for testing events.
         c. testing $rootScope is possible but it has to Share Data through $rootScope and because of this
             it is not a good practice.
         d.  To test controllers, the expected results has be mocked.