Book Image

Learning Aurelia

By : Manuel Guilbault
Book Image

Learning Aurelia

By: Manuel Guilbault

Overview of this book

<p>Aurelia is one of the most promising new JavaScript frameworks for mobile, desktop, and web, which makes developing powerful, modern web applications a straightforward task. Its power lies in its simplicity and clear workflow that enables developers to build next-generations apps for the web with ease.</p> <p>From initial structuring to full deployment, this book will serve as a step-by-step guide to develop a modern web application from scratch with the Aurelia framework. In addition to including a comprehensive coverage of various Aurelia framework features, this book will also show you how to utilize these features in the real world to develop a professional single-page web application. You’ll see how to make the most out of Aurelia by understanding the Aurelia workflow and then applying it in real-world development tasks. By the end of the book, you will have learned to develop a clean and maintainable application in Aurelia from scratch.</p>
Table of Contents (20 chapters)
Learning Aurelia
Credits
About the Author
About the Reviewer
www.PacktPub.com
Customer Feedback
Preface

Using built-in behaviors


The core library, aurelia-templating-resources, provides a set of standard behaviors, built on top of aurelia-templating, which can be used in any Aurelia template.

show

The show attribute controls the visibility of the element, based on the value of the expression it is bound to:

<template> 
  <p show.bind="hasError">An error occurred.</p> 
</template> 

In this example, the p element will be visible only when the model's hasError property is truthy.

This attribute works by injecting a CSS class either in the document head or in the nearest ShadowDOM root, and by adding this CSS class on the element whenever it should be hidden. This CSS class simply sets the display property to none.

hide

This is similar to show, but with an inverted condition:

<template> 
  <p hide.bind="isValid">Form is invalid.</p> 
</template> 

In this example, the p element will be hidden when the model's isValid property...