Skip to content

Instantly share code, notes, and snippets.

@balinterdi balinterdi/app.css
Last active Feb 3, 2016

Embed
What would you like to do?
Binding style attributes warning in Ember
body {
margin: 12px 16px;
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
font-size: 12pt;
}
.bordered {
border: 1px solid blue;
height: 100px;
}
import Ember from 'ember';
export default Ember.Controller.extend({
width: 50,
safeWidth: Ember.computed('width', function() {
let width = this.get('width');
return Ember.String.htmlSafe('width:'+ width + '%');
})
});
<div class="bordered" style="{{safeWidth}}"></div> <!-- This one still gives the warning -->
<div class="bordered" style={{safeWidth}}></div> <!-- This one does not -->
{{outlet}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.