javascript - Path of template in js file in Symfony/angular project -


i working on angularjs/symfony project , cant figure out how define correctly path of twig template in js.

the path to: -the original js -the template -the js path assetic

    ...     +-src/    | +-mycompany/    |   +-mybundle/    |     +-resources/    |       +-public/    |         +-js/    |           +-directive/    |             +-my_file.js    |       +-view/    |         +-template/    |            my_template.html.twig      +-web/    | bundles/    |   +-mybundle/    |     +-js/    |       +-my_fil.js    ... 

my js code:

return {     templateurl: '?' } 

so, there way include path bundle asset file? (i tried @bundle/ notation, didnt work). or, when include js in html, use js of bundle , not 1 of asset?

thanks

that be

{% javascripts filter='?uglifyjs2'     '@appbundle/resources/assets/js/your-file.js'     '@appbundle/resources/assets/js/your-second-file.js'     '@appbundle/resources/assets/js/admin-*.js' %}     <script type="text/javascript" src="{{ asset(asset_url) }}"></script> {% endjavascripts %} 

the filter allows apply, instance, uglifyjs in example. path points src/appbundle/resouces/assets/js/ , combine 2 files. it's possible use wildcards.


Comments

Popular posts from this blog

python - No exponential form of the z-axis in matplotlib-3D-plots -

php - Best Light server (Linux + Web server + Database) for Raspberry Pi -

c# - "Newtonsoft.Json.JsonSerializationException unable to find constructor to use for types" error when deserializing class -