denofevil / AureliaStorm

This plugin brings support for Aurelia framework to the IntelliJ platform
MIT License
35 stars 6 forks source link

Recognise visibility attributes #6

Open Vheissu opened 8 years ago

Vheissu commented 8 years ago

Visibility attributes in Aurelia, specifically in the HTML views for either conditionally removing and adding an element in the DOM or conditionally showing and hiding it.

Code examples

if.bind="myVariable" if.bind="!myVariable" if.bind="someVariable == 'this-string-value'" if.bind="someVariable == 'this-string-value' || someVariable == 'another value'"

show.bind="myVariable" show.bind="!myVariable" show.bind="someVariable == 'this-string-value'" show.bind="someVariable == 'this-string-value' || someVariable == 'another value'"

Notes:

if.bind inserts and removes the element from the DOM depending whether or not the supplied boolean value is truthy or falsy, also supports expressions.

show.bind simply does a display: none and display: initial behind the scenes. The element always remains in the DOM.