Issue
I need implement this: https://github.com/pshevtsov/flashcards into my Laravel Blade View. I tried to install angular and link all files in blade file. but it doesn't work, because laravel and angular use {{ }}
in files.
Solution
You can set custom AngularJS curly braces to prevent conflict with Blade template engine:
var app = angular.module('app', [])
.config(function($interpolateProvider) {
// To prevent the conflict of `{{` and `}}` symbols
// between Blade template engine and AngularJS templating we need
// to use different symbols for AngularJS.
$interpolateProvider.startSymbol('<%=');
$interpolateProvider.endSymbol('%>');
});
I suggest to use <%= %>
because it's the often used construction, you can find it in Underscore templates.
After that Angular code will look like this:
<li ng-repeat="phone in phones">
<p><%= phone.name %></p>
</li>
Answered By - Limon Monte
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.