amp-html

How can I view the Amp-State for a given component?


The AMP playground has a nifty tool to look at the Amp-State.

Look at the State Tab in the playground: https://playground.amp.dev/?url=https%3A%2F%2Fpreview.amp.dev%2Fdocumentation%2Fcomponents%2Famp-bind.example.1.html%3Fformat%3Dwebsites

Are there any dev tools that can show what the Amp State would be for my Amp Application?


Solution

    1. Enable AMP debug by adding #development=1 to the page address.
    2. Open Developer Tools in your browser (usually by pressing F12)
    3. In the Console tab, type AMP.printState().

    This will show something like [amp-bind] {burger: 'open'}.

    Source: AMP documentation