laravel pass collection to javascript

Solutions on MaxInterview for laravel pass collection to javascript by the best coders in the world

showing results for - "laravel pass collection to javascript"
Jonas
10 Oct 2020
1<script>    
2    var data = {!! json_encode($data, JSON_HEX_TAG) !!};
3</script>
Jacob
15 Nov 2019
1 @extends('AdLayout')
2     @section('content')
3   <  script type="text/javascript">
4      var app = angular.module('myApp', []);
5      app.controller('langCtrl', function($scope) {
6          $scope.languages = langs;
7      });
8   </script>
9
10   <div class="container-fluid" ng-app="myApp" ng-controller="langCtrl">
11      <div class="row">
12        <div class="col-md-8 col-md-offset-2">sdfsdf
13            <div class="panel panel-default">
14                <div class="panel-heading">
15                    <h2>Create language
16                    </h2>
17                </div>
18
19                <div class="panel-body">
20                    {!! Form::open() !!}
21                        <p class="text-center">
22                            {!! Form::label('Name','Language: ') !!}
23                            <input type="text" name="searchLanguage" ng-model="searchLanguage">
24                        </p>
25
26                        <select name="Name[]" multiple size="10" ng-model="lang" ng-click="show()">
27                            <option value="@{{v}}" ng-repeat="(k,v) in languages | filter:searchLanguage">
28                                @{{v}}
29                            </option>
30                        </select><br>
31
32                        <div class="text-center">
33                            {!! Form::submit('Create',['class'=>'btn btn-primary']) !!} 
34                              {!!   Html::linkAction('NAATIMockTest\LanguageController@index', 'Back', null, array('class' => 'btn btn-primary')) !!}
35                        </div>
36                    {!! Form::close() !!}
37                </div>
38            </div>
39        </div>
40    </div>
41    </div>
42   @endsection
43
similar questions
queries leading to this page
laravel pass collection to javascript