Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

t[e] is undefined. #154

Open
dtahir57 opened this issue Sep 16, 2018 · 0 comments
Open

t[e] is undefined. #154

dtahir57 opened this issue Sep 16, 2018 · 0 comments

Comments

@dtahir57
Copy link

Hello Developers Community,

I am using this brackets into my laravel app but I am stuck at a point and not sure how to configure this out.

I am fetching all the rounds against a tournament and each round has matches... I am trying to output the players name and their scores but I am not getting anything so far !!!

Here is my code of jquery and laravel... Please help me what I am missing.

`<script type="text/javascript">
var minimalData = {
teams : [
@foreach($tournament->bracket->rounds as $round)
@foreach($round->matches as $match)
@if($loop->last)
["{{json_encode($match->player1_name)}}", "{{json_encode($match->player2_name)}}"]
@else
["{{json_encode($match->player1_name)}}", "{{json_encode($match->player2_name)}}"],
@endif
@Endforeach
@Endforeach
],
results : [
[
@foreach($tournament->bracket->rounds as $round)
@if(!$loop->last)
[
@foreach($round->matches as $match)
@if(!$loop->last)
[{{$match->player1_score}}, {{$match->player2_score}}],
@else
[{{$match->player1_score}}, {{$match->player2_score}}]
@endif
@Endforeach
],
@else
[
@foreach($round->matches as $match)
@if(!$loop->last)
[{{$match->player1_score}}, {{$match->player2_score}}],
@else
[{{$match->player1_score}}, {{$match->player2_score}}]
@endif
@Endforeach
]
@endif
@Endforeach
]
]
}

$(function() {
    $('#minimal .demo').bracket({
      init: minimalData /* data to initialize the bracket with */ })
  })

</script>`

This is what I am doing but in the console , I am getting " TypeError: t[e] is undefined "

This is really frustrating and I am googling from 24 hours or maybe more... But no success why this error is showing !!!

Any help would be appreciated !!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant