Translation of headertext with angular-translate
$translate(['ROOM', 'CUSTNAME', 'DATE', 'CALLS', 'AMOUNT']).then(function (trans) {
$scope.cols = [
{ field: "ID", width: 150, visible: false },
{ field: "Extension", headerText: trans.ROOM, width: 180 },
{ field: "CustName", headerText: trans.CUSTNAME, width: 175 },
{ field: "Datetime", headerText: trans.DATE, width: 175},
{ field: "Calls", headerText: trans.CALLS, width: 180},
{ field: "Amount", headerText: trans.AMOUNT, width: 110 }
];
});
but simply the grid does not appear...
Can you please provide any clues? Can the angular-translate directives be used instead of trying to tranlate in the controller?
Thank you in advance
We are unable to reproduce the issue and please provide us below details,
1. If you got below script error,
Then refer to the below link for more information,
https://docs.angularjs.org/error/$injector/unpr?p0=$translateProvider%20%3C-%20$translate%20%3C-%20PhoneListCtrl
2. Share the script error details from console if any other.
3. Share the full code example that you have used to render the grid.
Regards,
Gowthami V.
{ field: "CheckoutID", width: 150, visible: false },
{ field: "Extension", headerText: $filter('translate')('ROOM'), width: 180 },
{ field: "CustName", headerText: $filter('translate')('CUSTOMERNAME'), width: 175 },
{ field: "DateTime", headerText: $filter('translate')('DATE'), width: 175, format: dateformat},
{ field: "Calls", headerText: $filter('translate')('CALLS'), width: 180, textAlign: "right", headertextAlign: "right" },
{ field: "Amount", headerText: $filter('translate')('AMOUNT'), width: 110, textAlign: "right", headertextAlign: "right", format: '{0:N2}' }
];
Thanks for your update.
We are happy that your issue is resolved.
Regards,
Ragavee U S.
- 3 Replies
- 3 Participants
-
UN Unknown
- Jan 25, 2016 02:42 PM UTC
- Jan 28, 2016 03:49 AM UTC