question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to show special character like '&' in placeholder attribute?

See original GitHub issue

So the text is ‘Cities & Suburbs’ in json. And I want to show exactly that in HTML for placeholder attribute.

I tried to do the followings but still got Cities & Suburbs on the screen

<input translate translate-attr-placeholder="{{translationId}}"/>
OR
<input placeholder="{{translationId | translate}}"/>

I know one solution is to change $translateProvider.useSanitizeValueStrategy('sanitize'); to $translateProvider.useSanitizeValueStrategy(); but this will make the application vulnerable.

Any other suggestions?

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Reactions:1
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

7reactions
artuskacommented, Jan 9, 2016

Just turn off the sanitize strategy 'cos it is totally broken:

angular.module('app').config(function($translateProvider) {
    $translateProvider.preferredLanguage('en');
    $translateProvider.useSanitizeValueStrategy(null);
});
0reactions
adeopura4commented, Jun 23, 2017

Hi artuska - Could you clarify what is the impact of changing the sanitize strategy?

Read more comments on GitHub >

github_iconTop Results From Across the Web

php - Display special characters on input placeholder with ...
I need to display a special character in the ...
Read more >
placeholder - CSS: Cascading Style Sheets - MDN Web Docs
The ::placeholder CSS pseudo-element represents the placeholder text in an or element.
Read more >
HTML input placeholder Attribute - W3Schools
The placeholder attribute specifies a short hint that describes the expected value of an input field (e.g. a sample value or a short...
Read more >
Don't Use The Placeholder Attribute - Smashing Magazine
The presence of a placeholder attribute won't be flagged by automated accessibility checking software. However, this doesn't necessarily mean ...
Read more >
Expression attribute names in DynamoDB - AWS Documentation
An expression attribute name is a placeholder that is used in an Amazon DynamoDB ... Reserved words; Attribute names containing special characters ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found