Laravel 5.2 and Angular moustaches issues

img55c7b18b8bd2eIf you are going to use Angularjs with Laravel 5.2 framework, chances are there you will stick in moustaches issue. By Moustaches issues I mean the curly braces used as template tags in Blade template system (like ‘{{ $variablename }}’). This causes issue with Angularjs because Angular also uses curly braces for its variable replacement with model values.

So, the solution is to add ‘@’ sign before the starting braces like:

@{{ variablename }}

This will prevent blade template engine to parse these curly braces and leave it for Angularjs for its processing.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s