Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make null values inherently htmlSafe #12681

Closed
Frozenfire92 opened this issue Dec 3, 2015 · 3 comments
Closed

Make null values inherently htmlSafe #12681

Frozenfire92 opened this issue Dec 3, 2015 · 3 comments

Comments

@Frozenfire92
Copy link
Contributor

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%;');
}
@robbiespeed
Copy link

+1

@pixelhandler
Copy link
Contributor

@rwjblue can this be closed? since #12686 prevents undefined and null from generating an htmlsafe warning

@rwjblue
Copy link
Member

rwjblue commented Dec 7, 2015

Yep, thanks @pixelhandler!

@rwjblue rwjblue closed this as completed Dec 7, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants