Created
November 23, 2017 17:51
-
-
Save chrishutchinson/52e6781faec20784f3aadafbf05dedfb to your computer and use it in GitHub Desktop.
This file contains 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
// HTML Element | |
<budget-calculator no-headline></budget-calculator> | |
// Polymer template code | |
<template is="dom-if" if="{{showHeadline}}"> | |
<h1>This is my headline</h1> | |
</template> | |
// Polymer JavaScript code | |
properties: { | |
noHeadline: { | |
type: Boolean, | |
value: false, | |
}, | |
showHeadline: { | |
type: Boolean, | |
computed: 'computeShowHeadline(noHeadline)' | |
} | |
}, | |
computeShowHeadline: function(noHeadline) { | |
// Return the opposite of `noHeadline`. | |
// If `noHeadline` is FALSE, then `showHeadline` will be TRUE | |
// If `noHeadline` is TRUE, then `showHeadline` will be FALSE | |
return !noHeadline; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment