私はテンプレート自体の中でディレクティブを使用しようとしています。JSテンプレート自体でディレクティブを使用する
しかし、データは決して私のアプリに届きません。フィールドは空白です。
誰でも手助けできますか?
.run(function($ionicPlatform, $ionicPopup, TranslationsService) {
$ionicPlatform.onHardwareBackButton(function() {
if(true) {
$scope.translations = TranslationsService.getData();
$ionicPopup.confirm({
title: 'System warning',
scope: $scope,
template: 'MESSAGE HERE {{translations.logout}}'
}).then(function(res){
if(res){
navigator.app.exitApp();
}
})
}
})
})
'TranslationsService.getData'メソッドを表示します。それはあなたがテンプレートを表示しようとしている解決する前に約束の呼び出しかもしれない。 –
はい、私は '$ scope.translations = TranslationsService.getData();'を入れようとしましたが、うまく動作しませんでした。私の注文/構文は間違っていると思いますか?私は答えを更新しました – Yian
はい。 '$ scope.translations = TranslationsService.getData();'この行は私が思う問題です。あなたは約束を返す必要があります。しかし、あなたの問題をよりよく理解するためのサービスコードを示してください。 –