AngularJS Development Guide 5: AngularJS expressions
AngularJS expressions are similar to Javascript code snippets, which are usually used in data binding and written in double braces, such as: {expression }}. The expression is processed using the $ parse method. The following are some valid AngularJS EXPRESSIONS 1 + 23*10 | currencyuser. name: You may think that the expression in AngularJS view is a Javascript expression, which is not completely correct because AngularJS does not use Javascript eval () functions to execute expressions. However, except for the following differences, you can regard AngularJS expressions as Javascript expressions: attribute expressions correspond to the current scope, unlike Javascript, it corresponds to a global window object. Undefined value allowed: AngularJS can allow undefined or null when executing an expression, unlike Javascript, which throws an exception. No control structure: you cannot use control structures such as "condition judgment", "loop", and "Throw exception" in AngularJS expressions. Filter (similar to the pipe operator in unix): You can pass the expression result through the filter chain. For example, convert a date object to a specified read-friendly format. If you want to use standard Javascript in an expression, you should write it as a controller method and then call this method in the expression. If you want to execute AngularJS expressions in Javascript, you can use the $ eval () method. For example: <! Doctype html>