【发布时间】:2017-04-03 17:55:44
【问题描述】:
我已经完成了 ionic 项目。我想更改此代码中的语言。项目标题、占位符、按钮已更改,但弹出窗口未更改。我在控制器和语言更改文件中使用了此代码。
farmer-ctrl.js:
function showPopup () {
$scope.data = {};
var myPopup = $ionicPopup.show({
template: '<input type="text" ng-model="data.category">',
title: '{{"farmers_message" | translate}}', //'Enter CoconutType',
scope: $scope,
buttons: [
{ text: 'Cancel' },
{
text: '<b>{{"save_message" | translate}}</b>',
type: 'button-positive',
onTap: function (e) {
if (!$scope.data.category) {
//don't allow the user to close unless he enters producttype
e.preventDefault();
} else {
$log.log('yes clicked: ', $scope.data.category);
addProductType();
return $scope.data.category;
}
}
},
]
});
myPopup.then(function (res) {
$log.log('Tapped!', res);
});
}
【问题讨论】:
标签: angularjs html css ionic-framework