Jump to content

Angular2 + BabylonJS Debug Layer


leanderr
 Share

Recommended Posts

Hey there,

I finally got BabylonJS to work within Angular2 but I cannot manage the DebugLayer to work with the solution offered here.

this._scene.debugLayer.show();

will always result in

babylon.inspector.bundle.js:408 Uncaught ReferenceError: BABYLON is not defined at INSPECTOR (babylon.inspector.bundle.js:408) at Object.<anonymous> (babylon.inspector.bundle.js:408) at __webpack_require__ (babylon.inspector.bundle.js:21) at Object.<anonymous> (babylon.inspector.bundle.js:49) at __webpack_require__ (babylon.inspector.bundle.js:21) at babylon.inspector.bundle.js:41 at babylon.inspector.bundle.js:44


core.es5.js:1084 ERROR TypeError: Cannot read property 'Inspector' of undefined
    at t._createInspector (babylon.js:36)
    at HTMLScriptElement.n.onload (babylon.js:3)
    at HTMLScriptElement.wrapFn [as __zone_symbol___onload] (zone.js:1199)
    at ZoneDelegate.invokeTask (zone.js:398)
    at Object.onInvokeTask (core.es5.js:4116)
    at ZoneDelegate.invokeTask (zone.js:397)
    at Zone.runTask (zone.js:165)
    at HTMLScriptElement.ZoneTask.invoke (zone.js:460)

 

Any Angular2 nerds around?

Side-Question: The fancy DebugLayer we got in the Playground is only available in the newest Version but not in 2.5, is it?

Best Regards

Link to comment
Share on other sites

  • 2 weeks later...
On 11.4.2017 at 3:36 PM, royibernthal said:

Hey leanderr

Out of curiosity, what would be the advantages of combining BabylonJS with Angular2?

Well, I want to have quite a lot of user Interface Pages that load once the User enters the page. I don't want any content to be downloaded after Page init except for a little bit of REST.

Link to comment
Share on other sites

If BABYLON is undefined it likely means you are requesting it out of sync. If you are diving into Angular then I am sure you are aware that you have to delay execution of your code until it has loaded. Furthermore, with the debug layer, you have to create it after all of your cameras/lights/meshes/etc have been loaded so it can reference them.

Link to comment
Share on other sites

6 hours ago, jeremybyington said:

Furthermore, with the debug layer, you have to create it after all of your cameras/lights/meshes/etc have been loaded so it can reference them

Not necessarily. You can create it bvefore and use the 'refresh' button in the inspector to refresh the current panel :)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...