0

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

2 Answers 2

1

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>
Sign up to request clarification or add additional context in comments.

Comments

0

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

<ng-include src="'{{  asset("assets/angular/companyApp/templates/products.html") }}'"></ng-include>

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.