<link rel="import" href="bower_components/polymer/polymer.html">
<link rel="import" href="sample-element-mixin.html">
<dom-module id="sample-element">
<link rel="stylesheet" type="css" href="sample-element.css">
<template>
<div>
<section hidden$="{{hideApp}}">
<div hidden$="{{!isChromeRuntime}}">
<h1>Configuration</h1>
<div>Hide App:</div><span>{{config.showDefaults.hideApp}}</span>
</div>
</section>
</template>
</dom-module>
<script>
Polymer({
mixins:[SampleElementMixin],
is:'sample-element',
properties:{
config:{
type:Object,
value:function(){ return {"showDefaults":{
"hideApp":true
}};}
},
hideApp:{
type:Boolean,
value:false
},
isChromeRuntime:{
type:Boolean,
computed:'computeIsChromeRuntime(config)',
observer:'isChromeRuntimeChanged'
}
},
created:function(){
if(this._data)
console.log("created",this.isChromeRuntime);
},
ready:function(){
console.log("ready",this.isChromeRuntime);
},
attached:function(){
console.log("attached",this.isChromeRuntime);
},
isChromeRuntimeChanged:function(val){
console.log("changed",val);
}
});
</script>
....
<script>
SampleElementMixin={
computeIsChromeRuntime:function(config){
return "chrome" in window && "runtime" in window.chrome;
}
}
</script>
Hi,
What is the official determination of using
mixinsas computed property or template methods? This sample was working early on in0.8-preview:In
0.8.0-rc.7, it does not seem that themixinmethods are available when the properties are computed, I am seeing errors like so: