Orane Orane - 3 years ago 151
AngularJS Question

How does quotes inside template expression work in angular1?

I'm working with an existing codebase and I need to figure out how this works:

{{'some_variable' | translate}}

It seems to correlate to
in an api call but I don't see it in the controller.

Answer Source

In this project you are using angular-translate...

This module offers you directive, filter and a service to add translation into your application...

In the example you gave you are using translate filter (if you are not familiar with the angular filters check out documentation)...

There are some options that how angular translate get your translations but at the end it will something like javascript object like this...

  some_variable: 'Some Variable translation'  

translate filter will take your input 'some_variable' and find value for it from given translations (if it cannot find anything it will return key itself)...

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download