Angular and Laravel Partials

Posted: 2014-02-13 09:32:00

Blade uses {{ }} so it does not play well with Angular.js but I decided to use partials. I am not using Angular routes so I am just including partials in my controller file.

My blade file has this.

<div ng-include="template.url">&nbsp;</div>

Then the partial has this

<div class="issues-to-get" ng-show="issues.length > 0">
<ul>
    <li><label><input type="checkbox" value="all" />All</label></li>
    <li ng-repeat="issue in issues"><label><input type="checkbox" value="{{ issue.id }}" />{{ issue.title }}</label></li>
</ul>
</div>

The partial lives here

/public/assets/js/templates/

which / is the root of my Laravel app.

Finally my controller has this

$scope.template = { name: 'project_issues', url: '/assets/js/templates/project_show.html'};

 


Tags:

laravel