You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@zeppelin.apache.org by Andrea Sosio <an...@xpeppers.com> on 2017/05/19 08:51:32 UTC

angularBinding a map to a dictionary

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 

Re: angularBinding a map to a dictionary

Posted by moon soo Lee <mo...@apache.org>.
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 <an...@xpeppers.com>
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
>