How to implement AngularJS app in Laravel Blade -


i need implement this: https://github.com/pshevtsov/flashcards laravel blade view. tried install angular , link files in blade file. doesn't work, because laravel , angular use {{ }} in files.

you can set custom angularjs curly braces prevent conflict blade template engine:

var app = angular.module('app', [])     .config(function($interpolateprovider) {     // prevent conflict of `{{` , `}}` symbols     // between blade template engine , angularjs templating need     // use different symbols angularjs.      $interpolateprovider.startsymbol('<%=');     $interpolateprovider.endsymbol('%>');   }); 

i suggest use <%= %> because it's used construction, can find in underscore templates.

after angular code this:

<li ng-repeat="phone in phones">     <p><%= phone.name %></p> </li> 

Comments

Popular posts from this blog

Email notification in google apps script -

c++ - Difference between pre and post decrement in recursive function argument -

javascript - IE11 incompatibility with jQuery's 'readonly'? -