I am trying to reference a twig file (mapCities.html.twig), from my main bandle, in a custom directive. Can anyone help me with this?
app.directive('customDirective', function() {
return {
restrict: 'E',
templateUrl: 'mapCities.html',
// template: '<div id="sampleCode">This is sample code</div>',
replace: true
}
})
- At the moment I am getting an 404 (as expected).
- My project is in Symfony2 & AngularJS
mapCities.html.twigfile is a view file internal to your Symfony app. It must be exposed using some sort of Route -> Controller -> View combo.templateUrlis. You simply can't access a Twig file directly using it.