angularjs expressions

1
Literals AngularJS Expressions 42 4.2 42E5 42e5 42e-5 Integer Floating point Scientific notation 'wat' "wat" "\n\f\r\t\v\'\"\\" "\u2665" Single-quoted string Double-quoted string Character escapes Unicode escapes true false null undefined Booleans null undefined [1, 2, 3] [1, [2, 'three']] {a: 1, b: 2} {'a': 1, "b": 'two'} Arrays Objects Parentheses expr; expr; expr a = 1; a + b Semicolon-separated Last one is returned Statements 2 * (a + b) (a || b) && c Alter precedence order Function Calls Member Access Operators In order of precedence Field lookup nested objects Property lookup Array lookup aKey aKey.otherKey.key3 aKey['otherKey'] aKey[keyVar] aKey['otherKey'].key3 anArray[42] aFunction() aFunction(42, 'abc') anObject.aFunction() anObject[fnVar]() Function calls Method calls -a +a !done a * b a / b a % b a + b a - b a < b a > b a <= b a >= b a == b a != b a === b a !== b a && b a || b a ? b : c aKey = val anObject.aKey = val anArray[42] = val a | filter a | filter1 | filter2 a | filter:arg1:arg2 Unary Multiplicative Additive Comparison Equality Locical AND Logical OR Ternary Assignment Filters BUILD YOUR OWN ANGULARJS teropa.info/build-your-own-angular

Upload: cannonfl

Post on 24-Dec-2014

219 views

Category:

Documents


0 download

TRANSCRIPT

Literals

AngularJS Expressions424.242E542e542e-5

IntegerFloating point

Scientific notation

'wat'"wat""\n\f\r\t\v\'\"\\""\u2665"

Single-quoted stringDouble-quoted string

Character escapesUnicode escapes

truefalsenullundefined

Booleans

nullundefined

[1, 2, 3][1, [2, 'three']]

{a: 1, b: 2}{'a': 1, "b": 'two'}

Arrays

Objects

Parentheses

expr; expr; expra = 1; a + b

Semicolon-separatedLast one is returned

Statements

2 * (a + b)(a || b) && c

Alter precedence order

Function Calls

Member Access

OperatorsIn order of precedence

Field lookupnested objects

Property lookup

Array lookup

aKeyaKey.otherKey.key3

aKey['otherKey']aKey[keyVar]aKey['otherKey'].key3anArray[42]

aFunction()aFunction(42, 'abc')

anObject.aFunction()anObject[fnVar]()

Function calls

Method calls

-a+a!done

a * ba / ba % b

a + ba - b

a < ba > ba <= ba >= b

a == ba != ba === ba !== b

a && b

a || b

a ? b : c

aKey = valanObject.aKey = valanArray[42] = val

a | filtera | filter1 | filter2a | filter:arg1:arg2

Unary

Multiplicative

Additive

Comparison

Equality

Locical AND

Logical OR

Ternary

Assignment

Filters

BUILD YOUR OWN ANGULARJSteropa.info/build-your-own-angular