Answer the question
In order to leave comments, you need to log in
How to retrieve the necessary data from the service?
In addition to my previous question .
How to get data back
[{
"name": {
"en": "name-english",
"de" : "name-deutch"
},
"title": {
"en": "english title",
"de": "deutch title"
}
}]
app.factory('DataJson', ['$resource','$translate', function($resource, $translate) {
var article = $resource('translate.json');
var CurrentLanguage = $translate.use() || $translate.storage().get($translate.storageKey()) || $translate.preferredLanguage();
var data = article; // Здесь ведь надо что-то сделать с ними и с CurrentLanguage
return data
}
]);
$scope.data = DataJson.query();
<div ng-repeat="vm in data">
{{vm.name}}<hr>
{{vm.title}}
</div>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question