'Angular: Print variable inside another

I have a variable {{type}} that I want to pass to another field called {{"SUB-MENU-PLACES.{{type}}"}}. But if I write that, what I get is an error, and I don't known how to print that certain variable inside another variable.

enter image description here

How to print that variable correctly on my HTML?



Solution 1:[1]

{{ SUB-MENU-PLACES[beach] | translate }}

Use the square brackets property accessor instead of the dot property accessor.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Pierre-Alain EMO