Created
March 9, 2017 00:31
-
-
Save rowellx68/6b4aa2ede5fdd0309585d483d2aa13ff to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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