Angular - Interview Questions and Answers for 'Angular' - 67 question(s) found - Order By Rating Q1. Can we have a directive that get's applied based on an attribute on a field ? Angular
Ans. Yes Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   Q2. How can we add a particular styling to a field based on a condition ? Angular
Ans. We can create a directive to do that. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   Q3. What is the use of ElementRef in angular ? Angular
This question is still unanswered. Can you please provide an answer. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   Q4. What is the use of Renderer class in angular ? Angular
This question is still unanswered. Can you please provide an answer. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   Q5. What is the use of NgControl ? Angular
This question is still unanswered. Can you please provide an answer. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   Q6. Can we have multiple selectors for a directive in Angular ? Angular
Ans. Yes Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   Q7. How can we add a text in front of all input fields in an application ? Angular
Ans. We can create a directive with selector as 'input' and then onInit of the directive , we can append the text to the input control html. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   Q8. Can we get the validators for a control in angular ? How ? Angular
Ans. No - https://github.com/angular/angular/issues/13461 Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   Q9. How can you trim all strings in an array ?
Ans. array.map(s => s.trim()) Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  java   angular   typescript   javascript Q10. What does this warning message for the unit test means
WARN: 'Spec has no expectations.' Angular
This question is still unanswered. Can you please provide an answer. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  Junit   Jasmine   Karma Q11. How can we sort an observable of a user array on user name ( name being one of the field of user ) ? RxJs
Ans. userArrayObservable.pipe(
map(userArray => {
return userArray.sort(comparator);
});
) Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  Angular Q12. Can we specify multiple maps within pipe ? RxJs
Ans. Yes, it's same as passing multiple methods within pipe. Output of one map is passed to second and so on. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  Angular Q13. Can we specify multiple functions in the pipe ? What happens if we do it ? RxJs
Ans. Yes, We can specify multiple functions within pipe method. In that case first function get's called with the observable , the response if then passed to the second method and so on. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  Angular Q14. Why do we do transformation on the observable itself rather than doing it in the subscriber ? RxJs
Ans. Because that way we just need to do that transformation at one place and not within each subscriber. Single source of truth. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  Angular   Observable  Suscriber Q15. What do we specify within the pipe method ? RxJs
Ans. Operator function to which an observable is passed for transformation. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  Angular Q16. What does pipe does on an observable ? RxJs
Ans. With pipe we specify the operator function to which this observable is passed for transforming the observable. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  Angular   Observable Q17. What is the difference between Subject and Observable ? Angular
This question is still unanswered. Can you please provide an answer. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  subject vs observable Q18. What is the difference between subscribe and unsubscribe ? Angular
This question is still unanswered. Can you please provide an answer. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  RxJs   subscribe vs unsubscribe Q19. What is the difference between subscribe and emit ? Angular
This question is still unanswered. Can you please provide an answer. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  subscribe vs emit Q20. Have you ever faced problem because of some listener / observers / subscriber performing action on the subscription which you don't want ? How did you fix the problem ? Angular
This question is still unanswered. Can you please provide an answer. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   Q21. What is the difference between closing and completing the observer / listener ? Angular
This question is still unanswered. Can you please provide an answer. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  observer   listener Q22. How can print the whole object state in the console in javascript ? Javascript
Ans. We can JSON.stringify Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  javascript  angular Q23. Can you please share best practices while designing an angular application ? Angular
This question is still unanswered. Can you please provide an answer. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   Q24. What are the benefits of using UI framework like Angular , View js etc instead of plain vanilla js and html ? Javascript
Ans. These frameworks facilitates easier product development and enhancement and maintainability by having separation of concerns ( using oops ) and helps in development of reusable libraries / components. So in nutshell , they make development and maintenance of large scale application easier. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  Javascript Frameworks  Angular  View js Q25. Have you ever had any problem with asynchronous programming due to race condition ? Angular
This question is still unanswered. Can you please provide an answer. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  race condition Q26. What is interpolation in Angular ? Angular
This question is still unanswered. Can you please provide an answer. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  interpolation Q27. What is a component decorator ? Angular
This question is still unanswered. Can you please provide an answer. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   Q28. What are the different conditions that triggers view update in case of push ChangeDetectionStrategy ? Angular
Ans. 1. Any change in Input
2. Any even originating from the component or it's child components
3. Explicit trigger Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  ChangeDetectionStrategy Q29. Which change detection strategy do you use in your application and Why ? Angular
Ans. We use ChangeDetectionStrategy.Push
As the application grows bigger , The default change detection strategy could become a performance overhead and hence should be avoided. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  ChangeDetectionStrategy Asked in 1 Companies Q30. Difference between ViewChild and ContentChild. Angular
Ans. Any directive, component, and element which is part of component template is accessed as ViewChild. Whereas, any element or component which is projected inside is accessed as ContentChild. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  ViewChild  ContentChild   ViewChild vs ContentChild