Using Angular JS and Laravel Blade together

I’ve just come across this error when messing around with Laravel. I needed to use Angular JS to do a simple task. This paticular task required me to use the ng-model="" and display what i entered with {{ Angular JS }} for example.

Laravel uses the curly braces too, so how can we get around this?

Well luckily Angular JS makes it quite easy to change the syntax and we can change this to stop it conflicting with Laravel/Blade.

So how do we do this?

It’s pretty simple, by adding the following Angular JS code to your project you will be able to change the syntax from {{ Angular JS }} to <% Angular JS %>.

Once you have added the above code to your project you can now reference Angular JS brackets as :

<% Angular JS %>

So That’s how you can make Angular JS and Laravel blade template engine work together nicely. I hope you enjoyed this quick tip on using Angular JS and Laravel Blade together.


Glenn Smith





© 2017, All Rights Reserved - Glenn Smith