Back to Amphtml

amp

examples/bind/errors.amp.html

latest1.2 KB
Original Source

Error & warning examples

This page lists the different types of runtime user errors that amp-bind can throw.


1. Binding to unsupported property

This paragraph element attempts to bind to "asdf".

2. Malformed expressions

This expression is missing a closing parens.

3. Invalid function invocation

This expression calls substring on a number.

4.a Invalid expression result (validator)

This expression contains an invalid URL protocol.

4.b Invalid expression result (css)

This expression contains an invalid [class] result (only string/array/null supported).

5. (WARN) Undefined variables and members

null

Expression above references an undefined variable foo.

null

Expression above references an undefined member myState.qux.

6. (WARN) Invalid member access

null

Expression above tries to access a boolean member.

null

Expression above tries to access a member of a boolean.

null

Expression above tries to access a null member.

null

Expression above tries to access a member of null.

7. Mismatched initial state

(Only with '#development=1')

This paragraph's initial text state doesn't match the evaluated expression result.