Skip to content

Make null values inherently htmlSafe #12681

Closed
@Frozenfire92

Description

@Frozenfire92

If I don't have a property set on a controller yet (could be set on an init function or similar) then you will get the deprecation notice for binding style attributes

Example

someInit: function(){
  this.set('myProp', Ember.String.htmlSafe('width: 50%;');
}
<div style={{myProp}}>...</div>

To fix this you must explicitly do the following (which seems a little overkill)

myProp: Ember.String.htmlSafe(""),
someInit: function(){
  this.set('myProp', Ember.String.htmlSafe('width: 50%;');
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions