Paladice
Paladice

Reputation: 247

angularjs : ng-view encoding issue

I have an issue with my web application.

I'm using AngularJs v1. When I'm wrinting

In my index.html I have :

<meta charset="utf-8" />
[...]
<button class="btn btn-success">Enregister les préférences</button>

I have this render on my browser (chrome or firefox) :

Enregister les préférences

But, with the same in my template HTML which replace the ng-view, I have :

Enregister les pr�f�rences

How to extends the charset of index.html to ng-view ?

Thanks.

Upvotes: 1

Views: 2316

Answers (3)

Tomasz Chudzik
Tomasz Chudzik

Reputation: 1947

I had the very same problem in an Angular app. In my case I needed to do the following sequence:

1. Add meta tag for UTF-8:

<head>
    <meta charset="utf-8" />
</head>

2. Open the html file e.g. in Notepad++, select all text and and convert it to UTF-8 without BOM (if there are other files connected with this html e.g. .css, .js or .tss do the same with them)

3. Restart your IDE (in my case VS2017) because your files might be cached and rebuild the project:

Upvotes: 0

Aarati
Aarati

Reputation: 321

If you add meta tag for each of the template HTML, then it works. For ex. below code

  <head>
  <meta charset="utf-8">
  </head>

However I think your question is about inheritance of meta tag inside template html. Not sure if its supported by w3

Upvotes: 1

Related Questions