Pass a php variable to aframe onclick function

Viewed 23

I'm very new to aframe and I would to pass a php variable to my click event. I know that in 2D javascript I just need to write onclick=myFunction('{{ $myVariable }}') but on aframe I'm yet to see an example like that.

here is my html code :

@foreach($files as $file)
  <a-entity id="gif-display1">
     <a-entity position="2 0 -7" mixin="edit" id="edit_{{$file->id}}"></a-entity>     
     <a-entity position="-2 0 -7" mixin="delete" id=="delete_{{$file->id}}"></a-entity>        
  </a-entity foo>
 @endforeach

Here is my javascript

AFRAME.registerComponent('foo' {
                        init:function(){
                         // what do I put here? I need to get the id of the entity clicked

                        })

Anybody know how do to that? Please help. Thanks

0 Answers
Related