I'm having trouble using AngularJS along with Laravel's Blade. After searching this site myself, I discovered that to resolve the conflict with Laravel the most recent method is using @{{}}
in variable calls.
The page is loaded, array
is traversed, generating the rows of the records, but no information is shown.
Here is the piece of my code that gives this error:
<table class="table table-striped">
<thead>
<tr>
<th ng-click="ordenar('convite.id')">Nº Convite</th>
<th ng-click="ordenar('convite.numero')">Processo</th>
<th ng-click="ordenar('convite.descricao')">Descrição</th>
<th>Lançado em:</th>
<th></th>
</tr>
</thead>
<tbody>
<tr dir-paginate="convite in convites | filter: pesquisar |orderBy:sortKey:reverse |itemsPerPage:5">
<td>
00 @{{convite.id}} @{{convite.ano}}/NFS
</td>
<td>@{{convite.numero}}</td>
<td>@{{convite.descricao}}</td>
<td>@{{convite.create_up}}</td>
<td>
<button class="btn btn-info btn-xs" ng-click="editar(convite)">Editar</button>
<button class="btn btn-danger btn-xs" ng-click="excluir(convite)">Excluir</button>
</td>
</tr>
</tbody>
</table>
I also read that I should not use the Blade with Angular, but I find it very practical to use, and I would like to continue. Is this method the most correct and recent?
Well, I've already done some of the change of the Blade keys, I have to make an interpolation to change the Angular, and it's in the same error.
The page loads without error in Laravel, but does not load the information.
As I can not comment, I'll edit it.
So far so it is
var app = angular.module('cdg',['angularUtils.directives.dirPagination']);
angular.module('cdg').config(function($interpolateProvider) {
$interpolateProvider.startSymbol('<%');
$interpolateProvider.endSymbol('%>');
});
And PHP:
<?php
namespace confin\Providers;
use Illuminate\Support\ServiceProvider;
use Blade;
class AppServiceProvider extends ServiceProvider
{
/**
* Bootstrap any application services.
*
* @return void
*/
public function boot()
{
Blade::setContentTags('<%', '%>');
Blade::setEscapedContentTags('<%%', '%%>');
}
/**
* Register any application services.
*
* @return void
*/
public function register()
{
//
}
}
<tr dir-paginate=" convite in convites | filter: pesquisar |orderBy:sortKey:reverse |itemsPerPage:5">
<td>
00 <% convite.id %><% convite.ano %>/NFS
</td>
<td><% convite.numero %></td>
<td><% convite.descricao %></td>
<td><% convite.create_up %></td>
<td>
<button class="btn btn-info btn-xs" ng-click="editar(convite)">Editar</button>
<button class="btn btn-danger btn-xs" ng-click="excluir(convite)">Excluir</button>
</td>
</tr>
but now the error is in this line
<tr dir-paginate=" convite in convites | filter: pesquisar |orderBy:sortKey:reverse |itemsPerPage:5">
ErrorException in b021106ac8c34a8a693202610529e170cbe12876.php line 49: Use of undefined constant invitation - assumed 'invitation' (View: C: \ xampp \ htdocs \ confin \ resources \ views \ invitation.blade.php)