AngularJS Interview Questions

9. Explain internationalization?
Internationalization is a way to show locale specific information on a website. For example, display content of a website in English language in United States and in Danish in France.

10. Explain how e2e testing of AngularJS applications work?
The e2e tests are executed against a running app, that is a fully initialized system. They most often spawn a browser instance and involve the actual input of commands through the user interface. The written code is evaluated by an automation program, such as a Selenium server (webdriver). That program sends commands to a browser instance, then evaluates the visible results and reports back to the user.

11. Explain how do you share data between controllers?
Create an AngularJS service that will hold the data. Inject it inside of the controllers.
Using a service is the cleanest, fastest and easiest way to test.
Using events
Using $parent, nextSibling, controllerAs, etc. to directly access the controllers
Using the $rootScope to add the data on (not a good practice)

12. Can we create a custom directive in Angukar JS, If so on which type of components you can create that?
Element directives − Directive activates if a matching element is encountered.
Attribute − Directive activates if a matching attribute is encountered.
CSS − Directive activates if a matching css style is encountered.
Comment − Directive activates if a matching comment is encountered.

Comments are closed here.