The Conflict:
Peoples who are using Laravel and AngularJs may know, Laravel’s Blade templating engine and AngularJs uses the same markup when displaying variables{{ variableName }}
Solution 1 (Laravel):
Laravel Blade template engine comes with an option to change the literal tags. so if you want to keep the angular syntax, then include the following code in app/routes.php
//general syntax
Blade::setContentTags('<%', '%>');
//for escaped data:
Blade::setEscapedContentTags('<%%', '%%>');
Solution 2 (AngularJs):
AngularJs comes with an option to change the literal tags using $interpolateProvider
It should be declared within your module.angular.module('MyApp', [], function($interpolateProvider) {
$interpolateProvider.startSymbol('<%');
$interpolateProvider.endSymbol('%>');
});
Comments
Post a Comment