Search code examples
javascriptmustacheamp-html

How can I use console log in AMP and Mustache?


I'm looking at the AMP Specifications and unable to find any way to log local variables on console.

Trying to achieve auto suggest by following the example from AMP Examples. Is there a way I can print either response from apm-list or print option item (set using option="{{.}}" in amp-selector) on console?


Solution

  • If you set the #development=1 query parameter in your URL, you can use the AMP.printState() in the console to pretty-print status of the present state variables present.

    You can find more about it Here


    Edit: camelCase correction, as mentioned by @fabian-marz