Skip to content

Instantly share code, notes, and snippets.

@rowellx68
Created March 9, 2017 00:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rowellx68/6b4aa2ede5fdd0309585d483d2aa13ff to your computer and use it in GitHub Desktop.
Save rowellx68/6b4aa2ede5fdd0309585d483d2aa13ff to your computer and use it in GitHub Desktop.
import { inject, bindable } from "aurelia-framework";
@inject(Element)
export class RedCustomAttribute {
constructor(element) {
}
@bindable value;
valueChanged(newValue) {
if (newValue < 0) {
this.element.className += " red";
} else {
this.element.className = this.element.className.replace("red", "");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment