AngularJS Developer Question: Download Questions PDF
What is Angular Expression? How do you differentiate between Angular expressions and JavaScript expressions?
Answer:
Angular expressions are code snippets that are usually placed in binding such as {{ expression }} similar to JavaScript.
The main differences between Angular expressions and JavaScript expressions are:
Context : The expressions are evaluated against a scope object in Angular, while Javascript expressions are evaluated against the global window
Forgiving: In Angular expression, the evaluation is forgiving to null and undefined whereas in JavaScript undefined properties generate TypeError or ReferenceError
No Control Flow Statements: We cannot use loops, conditionals or exceptions in an Angular expression
Filters: In Angular unlike JavaScript, we can use filters to format data before displaying it
The main differences between Angular expressions and JavaScript expressions are:
Context : The expressions are evaluated against a scope object in Angular, while Javascript expressions are evaluated against the global window
Forgiving: In Angular expression, the evaluation is forgiving to null and undefined whereas in JavaScript undefined properties generate TypeError or ReferenceError
No Control Flow Statements: We cannot use loops, conditionals or exceptions in an Angular expression
Filters: In Angular unlike JavaScript, we can use filters to format data before displaying it
Download AngularJS Developer Interview Questions And Answers
PDF
Previous Question | Next Question |
what is DI (Dependency Injection ) and how an object or function can get a hold of its dependencies? | Tell me what are the advantages of using Angular.js framework? |