angularBinding a map to a dictionary

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

angularBinding a map to a dictionary

Andrea Sosio
Hello list,

is there a way to bind a map to a dictionary in such a way that the map (key, value) structure is actually preserved?

I'm doing something like

%spark
    val mymap = Map("mykey"->"myvalue")
    z.angularBind("mydictionary", mymap)

%angular
   my dictionary is:  {{mydictionary}}


I would like to get something like
   
    my dictionary is: {"mykey" : "myvalue"}

but what I get is instead:

   my dictionary is: {"key1":"mykey","value1":"myvalue"}

So angularBind maps my map into a dictionary (good), yet not in the smartest way (from my POV).

Thanks for any help
Andrea 
Reply | Threaded
Open this post in threaded view
|

Re: angularBinding a map to a dictionary

moon
Administrator
Hi,

You can try create java Map instead of scala Map.
That'll give expected output.

Thanks,
moon

On Fri, May 19, 2017 at 4:51 AM Andrea Sosio <[hidden email]> wrote:
Hello list,

is there a way to bind a map to a dictionary in such a way that the map (key, value) structure is actually preserved?

I'm doing something like

%spark
    val mymap = Map("mykey"->"myvalue")
    z.angularBind("mydictionary", mymap)

%angular
   my dictionary is:  {{mydictionary}}


I would like to get something like
   
    my dictionary is: {"mykey" : "myvalue"}

but what I get is instead:

   my dictionary is: {"key1":"mykey","value1":"myvalue"}

So angularBind maps my map into a dictionary (good), yet not in the smartest way (from my POV).

Thanks for any help
Andrea