You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@zeppelin.apache.org by on <sc...@web.de> on 2016/07/08 18:03:25 UTC
Pass parameters to paragraphs via URL
Hi,
I am trying to pass parameters via URL to a published paragraph (and to
run it after that), e.g., I would like to get variable test of
/paragraph/20160708-144835_1515469620?asIframe&test=123 within my python
context, calculating a bit and then printing the result in the paragraph
(so that it appears on the website).
Is this even possible?
Thanks and best regards,
ON
Re: Pass parameters to paragraphs via URL
Posted by "duncan.folkes@gmail.com" <du...@gmail.com>.
On 2016-07-13 16:34 (-0000), TEJA SRIVASTAV <te...@gmail.com> wrote:
> PS typo
> <div ng-init="z.angularBind('params',getLocationParams,'ourParagraphId')
> "></div>
> <div ng-init="z.angularBind('params',getLocationParams(),'ourParagraphId')
> "></div>
>
> On Wed, Jul 13, 2016 at 9:03 PM TEJA SRIVASTAV <te...@gmail.com>
> wrote:
>
> > We do have work around for that but Validate.
> > You need to use angularBinding to achieve it
> > %angular
> > <script>
> > var
> > scope=angular.element(document.getElementById("main")).scope().$root.compiledScope;
> > scope.getLocationParams = function(){
> > var pairs = window.location.search.substring(1).split("&"),
> > obj = {},
> >
> > pair,
> > i;
> >
> > for ( i in pairs ) {
> > if ( pairs[i] === "" ) continue;
> >
> > pair = pairs[i].split("=");
> > obj[ decodeURIComponent( pair[0] ) ] = decodeURIComponent( pair[1] );
> > }
> >
> > return obj;
> >
> > </script>
> > <div ng-init="z.angularBind('params',getLocationParams,'ourParagraphId')
> > "></div>
> >
> > On Wed, Jul 13, 2016 at 3:02 PM Rajesh Balamohan <
> > rajesh.balamohan@gmail.com> wrote:
> >
> >> +1 on this. I am not sure if this is possible. If so, it would be really
> >> helpful.
> >>
> >> ~Rajesh.B
> >>
> >> On Fri, Jul 8, 2016 at 11:33 PM, on <sc...@web.de> wrote:
> >>
> >>> Hi,
> >>>
> >>> I am trying to pass parameters via URL to a published paragraph (and to
> >>> run it after that), e.g., I would like to get variable test of
> >>> /paragraph/20160708-144835_1515469620?asIframe&test=123 within my python
> >>> context, calculating a bit and then printing the result in the paragraph
> >>> (so that it appears on the website).
> >>>
> >>> Is this even possible?
> >>>
> >>> Thanks and best regards,
> >>> ON
> >>>
> >>
> >>
> >>
> >> --
> >> ~Rajesh.B
> >>
Sorry to resurrect this thread, but the above solution no longer works (subsequent to the changes in 0.6?) . I've been digging around a fair amount but don't yet have a working solution - anyone got this working with \u22650.6?
Re: Pass parameters to paragraphs via URL
Posted by TEJA SRIVASTAV <te...@gmail.com>.
PS typo
<div ng-init="z.angularBind('params',getLocationParams,'ourParagraphId')
"></div>
<div ng-init="z.angularBind('params',getLocationParams(),'ourParagraphId')
"></div>
On Wed, Jul 13, 2016 at 9:03 PM TEJA SRIVASTAV <te...@gmail.com>
wrote:
> We do have work around for that but Validate.
> You need to use angularBinding to achieve it
> %angular
> <script>
> var
> scope=angular.element(document.getElementById("main")).scope().$root.compiledScope;
> scope.getLocationParams = function(){
> var pairs = window.location.search.substring(1).split("&"),
> obj = {},
>
> pair,
> i;
>
> for ( i in pairs ) {
> if ( pairs[i] === "" ) continue;
>
> pair = pairs[i].split("=");
> obj[ decodeURIComponent( pair[0] ) ] = decodeURIComponent( pair[1] );
> }
>
> return obj;
>
> </script>
> <div ng-init="z.angularBind('params',getLocationParams,'ourParagraphId')
> "></div>
>
> On Wed, Jul 13, 2016 at 3:02 PM Rajesh Balamohan <
> rajesh.balamohan@gmail.com> wrote:
>
>> +1 on this. I am not sure if this is possible. If so, it would be really
>> helpful.
>>
>> ~Rajesh.B
>>
>> On Fri, Jul 8, 2016 at 11:33 PM, on <sc...@web.de> wrote:
>>
>>> Hi,
>>>
>>> I am trying to pass parameters via URL to a published paragraph (and to
>>> run it after that), e.g., I would like to get variable test of
>>> /paragraph/20160708-144835_1515469620?asIframe&test=123 within my python
>>> context, calculating a bit and then printing the result in the paragraph
>>> (so that it appears on the website).
>>>
>>> Is this even possible?
>>>
>>> Thanks and best regards,
>>> ON
>>>
>>
>>
>>
>> --
>> ~Rajesh.B
>>
>
Re: Pass parameters to paragraphs via URL
Posted by TEJA SRIVASTAV <te...@gmail.com>.
We do have work around for that but Validate.
You need to use angularBinding to achieve it
%angular
<script>
var
scope=angular.element(document.getElementById("main")).scope().$root.compiledScope;
scope.getLocationParams = function(){
var pairs = window.location.search.substring(1).split("&"),
obj = {},
pair,
i;
for ( i in pairs ) {
if ( pairs[i] === "" ) continue;
pair = pairs[i].split("=");
obj[ decodeURIComponent( pair[0] ) ] = decodeURIComponent( pair[1] );
}
return obj;
</script>
<div ng-init="z.angularBind('params',getLocationParams,'ourParagraphId')
"></div>
On Wed, Jul 13, 2016 at 3:02 PM Rajesh Balamohan <ra...@gmail.com>
wrote:
> +1 on this. I am not sure if this is possible. If so, it would be really
> helpful.
>
> ~Rajesh.B
>
> On Fri, Jul 8, 2016 at 11:33 PM, on <sc...@web.de> wrote:
>
>> Hi,
>>
>> I am trying to pass parameters via URL to a published paragraph (and to
>> run it after that), e.g., I would like to get variable test of
>> /paragraph/20160708-144835_1515469620?asIframe&test=123 within my python
>> context, calculating a bit and then printing the result in the paragraph
>> (so that it appears on the website).
>>
>> Is this even possible?
>>
>> Thanks and best regards,
>> ON
>>
>
>
>
> --
> ~Rajesh.B
>
Re: Pass parameters to paragraphs via URL
Posted by Rajesh Balamohan <ra...@gmail.com>.
+1 on this. I am not sure if this is possible. If so, it would be really
helpful.
~Rajesh.B
On Fri, Jul 8, 2016 at 11:33 PM, on <sc...@web.de> wrote:
> Hi,
>
> I am trying to pass parameters via URL to a published paragraph (and to
> run it after that), e.g., I would like to get variable test of
> /paragraph/20160708-144835_1515469620?asIframe&test=123 within my python
> context, calculating a bit and then printing the result in the paragraph
> (so that it appears on the website).
>
> Is this even possible?
>
> Thanks and best regards,
> ON
>
--
~Rajesh.B