question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

@builder.io/angular Data passing and custom actions not persist in builder.io state

See original GitHub issue

Hello, I trying to pass data to builder component like this

<builder-component *ngIf="visible"
                     [data]="data"
                     [model]="computedModel$ | async"
                     [options]="optionsCombined"
                     [reloadOnRoute]="false"
                     [handleRouting]="true"
                     [prerender]="false"
                     [navigationTimeout]="false"
                     (load)="load($event)"
                     (route)="routeChanged($event)"
                     (error)="error($event)">
 </builder-component>

The data includes some properties: data = { myFunc: () => alert('wooow!'), b: 'c'};

But when I tried to read it from the state in builder.io I am getting an error:

Builder custom code error: state.myFunc is not a function in console.log(state.myFunc()) 

image

I am 100% it was working fine a few months back.

Note: I am using prerender=flase Note 2: Not working with "@builder.io/angular": "1.1.10" and "@builder.io/angular": "1.1.11-alpha.2"

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:1
  • Comments:12 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
ca136commented, Jun 26, 2020

We may have a fix for this, going to test it out locally now. I’ll update this issue when I have more information.

0reactions
tomekknowdecommented, May 18, 2022

@ca136, any progress with this issue?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Building Interactivity Using State and Actions - Builder.io
Then, click “from” and select “hidden”. To learn more about how to add custom code to state bindings or action handlers ...
Read more >
Technical Questions - Builder.io Forum
You absolutely can - using the data prop of the BuilderComponent React component. Anything you pass there will be available on state in...
Read more >
Observables, Change detection and actions - Builder.io Forum
be used when passing data back to builder (state) or do i have to subscribe in angular and pass the data? Change detection...
Read more >
Triggering Custom Actions in Builder with React
Let's assign our function to run on click of a button. Using the data tab, create a new "click" event. In the event...
Read more >
Angular integration - CMS - Builder.io Forum
Hi, How could builder.io be used with an existing angular project. The project already has all a data layer and components coded up....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found