HEADLINE & INTRO_TEXT ne sont pas remplacés
Bonjour,
je fais mes premiers pas avec la librairie AngularJS, j'ai crée:
1- une page myangular.js sous un dossier js:
Code:
1 2 3 4 5 6 7 8
| var app = angular.module('TestSwitchMenu', ['pascalprecht.translate']);
app.config(function($translateProvider) {
$translateProvider.translations('en', {
HEADLINE: 'Hello there, This is my awesome app!',
INTRO_TEXT: 'And it has i18n support!'
});
}); |
2- le fichier index.html:
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
| <!DOCTYPE html><!--HTML5 doctype-->
<html ng-app>
<head>
<title>Your New Application</title>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=0" />
<style type="text/css">
/* Prevent copy paste for all elements except text fields */
* { -webkit-user-select:none; -webkit-tap-highlight-color:rgba(255, 255, 255, 0); }
input, textarea { -webkit-user-select:text; }
body { background-color:white; color:black }
</style>
<script src='intelxdk.js'></script>
<script type="text/javascript">
/* This code is used to run as soon as Intel activates */
var onDeviceReady=function(){
//hide splash screen
intel.xdk.device.hideSplashScreen();
};
document.addEventListener("intel.xdk.device.ready",onDeviceReady,false);
</script>
<script>
function langSwitch(){
}
</script>
<script src="libs/angular.js"></script>
<script src="libs/angular-translate.js"></script>
<script src="js/myangular.js" type="text/javascript"></script>
</head>
<body>
<h2>{{ 'HEADLINE' | translate }}</h2>
<p>{{'INTRO_TEXT' | translate }}</p>
</body>
</html> |
le problème c'est que lors de l'affichage, je reçois toujours
Citation:
{{ 'HEADLINE' | translate }}
{{'INTRO_TEXT' | translate }}
C'est à dire que les valeurs HEADLINE + INTRO_TEXT ne sont pas remplacés par leurs valeurs correspondantes. :weird:
C'est quoi le problème? :calim2:
Merci d'avance! :D