The answer above is a good idea, however I don't like the idea of ββasking for a routing pattern. We will create a route for each component: c. I leave my solution here:
- In gulpfile.js inside the elixir function, add this line:
var elixir = require('laravel-elixir');
elixir(function(mix) {
mix.copy('resources/assets/js/angular/components/**/*.template.html', public/angular-templates');
//Find all files with suffix .template.html
});
, "angular", , "",
Angular-----------------------------
--Components------------------------
----my-component.directive.js-------
----my-component.template.html------
- angular, (www.myapp.com, localhost: 8000 ..), :
angular.module('myModule',[])
.value('pathAssets', location.origin + '/angular-templates/')
- urll , :
templateUrl: pathAssets + '../angular-templates/my-template.html',
, angular , D: , , gulpfile.js
mix.scripts([
'../../../bower_components/angular/angular.min.js',
'angular/app.js',
'angular/controllers/**/*.controller.js',
'angular/components/**/*.directive.js',
'angular/bootstrap.js',
], 'public/js/app.js'); //We concatenate angular files saving them in app.js
- , 'gulp' ( ), angular -templates.
:)