My ionic app stores user data, such as name, in localStorage. I went to do a test, I logged in with the name of my wife, Flavia, but when I looked at the console in the Resources tab, the name field was null and the id had its user id. I went to the bank to change her name, I took the accent from the letter a. I came back, I logged in and her name appeared! Do you know if localStorage allows you to store names with an accent? If not, how should I do it?
Part of index.html:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">
<title></title>
My login.html:
<ion-view title="Login" hide-back-button="true">
<ion-content overflow-scroll="true" padding="true" class="has-header">
<form class="list">
<ion-list>
<div ng-controller="loginCtrl">
<label class="item item-input">
<input type="text" ng-model="usuario.email" placeholder="E-mail">
</label>
<label class="item item-input">
<input type="password" ng-model="usuario.senha" placeholder="Senha">
</label>
</ion-list>
<div class="spacer" style="height: 40px;"></div>
<button class="button button-stable button-block" ng-click="logar(usuario)">Entrar</button>
<!--<a href="#/salas" class="button button-stable button-block ">Entrar</a> -->
<a href="#/cadastroCep" class="button button-stable button-block ">Cadastre-se</a>
<div align="center">{{msgErro}}</div>
</div>
</form>
</ion-content>
My controller.js
.controller('loginCtrl', function ($scope, $http, $state, $location, $window) {
$scope.usuario = {
email: "",
senha: ""
}
$scope.msgErro = '';
$scope.msgExiste = '';
$scope.logar = function (usuario) {
$http.post("http://www.vigilantescomunitarios.com/www/php/login.php", usuario).success(function (response){
if(response == ''){
$location.path('/page10');
$scope.msgErro = "E-mail ou senha inválido";
}else if(typeof(Storage) !== "undefined") {
$window.localStorage.setItem("idUsuario", response.idUsuario);
$window.localStorage.setItem("idCep", response.idCep);
$window.localStorage.setItem("nome", response.nome);
$location.path('/salas');
} else {
console.log("Desculpe, mas o navegador nao possui suporte a Web Storage.");
}
})
}
})