2

My code is like this:

function enableUser(Restangular, $state, notification) {
    ...
    ...
    notification.log(
        {{ "DISABLED_LOG_DISABLE" | translate }},
        { addnCls: 'humane-flatty-success' });
}

I found that it will display {{ "DISABLED_LOG_DISABLE" | translate }} directly to the screen but what I need is Disabled employee when I give it {'DISABLED_LOG_DISABLE': 'Disabled employee'}

tanmay
  • 7,761
  • 2
  • 19
  • 38
Hsw
  • 37
  • 5

1 Answers1

1

This expression is used in HTML file "{{ "DISABLED_LOG_DISABLE" | translate }" What you should do is inject $translate and then you call it. For example:

$translate('DISABLED_LOG_DISABLE').then(function(translatedString) {...})

I guess you are using angular-translate.

Ramy Rais
  • 140
  • 2
  • 10