Question

I try to write angular app base on symfony framework

here try this codes in main twig

<div ng:include src="'/Learn/web/bundles/learn/view/test01.html'"></div>

<div ng:include src="/Learn/web/bundles/learn/view/test01.html"></div>

<div ng:include src="'{{ asset("bundles/learn/view/test01.html") }}'"></div>

<div ng:include src="{{ asset("bundles/learn/view/test01.html") }}"></div>

"test01.html" address : Learn/web/bundles/learn/view/test01.html

I cant get answer from any of this code

Also i dont know how set template address for my routes in angular when use symfony

Thanks

Was it helpful?

Solution

You must :

  • create a new entry in your controller, with the route "learn/view/test01" and the name "learn_test01"

  • In your twig template :

    <div ng-include src="'{{path('learn_test01')}}'"></div>

or

   <div ng-include src="'learn/view/test01'"></div>

OTHER TIPS

I placed my templates in my asset folder and called asset() function:

<ng-include src="'{{  asset("assets/angular/companyApp/templates/products.html") }}'"></ng-include>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top