Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
23 lines (19 sloc) 959 Bytes
extends ../docs-base
block doc
h1 Element referencing
p.
When developing your app, sometimes it is needed for fig to let other
libraries/parts of the code manage the DOM inside your app. For this
reason, fig provides a #[b +skip] mixin, which as the name suggests,
forces fig to ignore that part of the DOM tree after initial render.
The editor you see on this website uses this functionality to let
#[a(href='https://codemirror.net/') CodeMirror] function properly.
p Let's see an example!
include ../../examples/element-referencing
p.
If you open your developer console (F12 in most browsers), you should
see an element being logged. Skipped elements are attached to the
app instance's #[b .ref] property, with their names being determined by
the variable passed to the #[b skip] mixin. For more complex usage, see
the code editor's
#[a(href='https://github.com/nikersify/fig-web/blob/master/src/js/editor.js') source code].