JSFiddle - React, Tailwind, and code Playground
by ysangkok
HTML
<!doctype html>
<html ng-app="myApp" ng-controller="LanguageCtrl">
<head>
<script src="http://code.angularjs.org/1.0.2/angular.js"></script>
</head>
<body>
{{t.strlanguage}}<br>
<select ng-change="languageChange()" ng-model="currentLanguage" ng-options="lan.nativename for lan in langFiles">
</select>
<br>
{{currentLanguage}}
</body>
</html>
JavaScript
var module = angular.module('myApp', [])
.controller('LanguageCtrl', ['$scope', '$locale', '$http', function($scope, $locale, $http) {
$http.get('http://tyskland.goxadidi.dk:8800/jsppa/languages.php').success(function(data){
$scope.langFiles = data.appLangFiles;
var entry = $scope.langFiles[0];
$scope.currentLanguage = entry;
$scope.t = {};
$scope.languageChange = function() {
/*
Object.keys(data.texts[$scope.currentLanguage.id]).map(function(v) {
$scope.t[v] = data.texts[$scope.currentLanguage.id][v];
});
*/
$scope.t = data.texts[$scope.currentLanguage.id];
};
$scope.languageChange();
});
}]);