10 Essential AngularJS Interview Questions - from toptal.com | CrazyEgg
This article is forward from http://www.toptal.com/angular-js/interview-questions 1. What are the ways to communicate between modules of your application using core AngularJS functionality? Name three ways. Communication can happen: Directly between controllers, using $parent, nextSibling, etc Directly between controllers, using ControllerAs, or other forms of inheritence In the community, there are also mentions of less popular methods such as using watches or the URL. 2. Which means of communication between modules of your application are easily testable? Using a service is definitely easy to test. Services are injected, and in a test either a real service can be used or it can be mocked. Events can be tested. In unit testing controllers, they usually are instantiated. For testing events on $rootScope, it must be injected into the test. Testing $rootScope against the existence of some arbitrary models is testable, but sharing data through $rootScope is not considered a good practice.Read full article from 10 Essential AngularJS Interview Questions - from toptal.com | CrazyEgg
No comments:
Post a Comment