1
0
-1

I would like to understand the syntax being used here:

{{T[item.id].label}}

and

{{T[Form.view.id].label}}


What is the meaning of the T and the square brackets?

    CommentAdd your comment...

    1 answer

    1.  
      3
      2
      1

      T is the Maestro object containing literal strings for the current language... and anything in square brackets in Javascript is an accessor to get at a property on the object of that name.  

      So that code is using the item id to get to the translation values for the item, and pulling out the label property for it.

      In Javaxcript, object['abc'] is the same as object.abc, but if you have the value 'xyz' stored in a variable 'def', then object[def] is the same as object.xyz.

      The {{ }} syntax is AngularJs expression language, which will evaluate the expression inside {{ }}

        CommentAdd your comment...