Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recognise visibility attributes #6

Open
2 of 4 tasks
Vheissu opened this issue Aug 22, 2016 · 0 comments
Open
2 of 4 tasks

Recognise visibility attributes #6

Vheissu opened this issue Aug 22, 2016 · 0 comments

Comments

@Vheissu
Copy link

Vheissu commented Aug 22, 2016

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.

  • Recognise if.bind attribute
  • Recognise show.bind attribute
  • Code insight for variable/boolean value
  • Code insight for expression

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant