javascript - AngularJS directive - accessing parent attribute from templateUrl method -


I have no control as items list with nested items.

  • Item 2
  • Item
  • P> Inside item instructions, I like this template url Can set:

      templateUrl: (tElement, tAttrs) -> TAttrs.template or '/item-template.html'  

    This works fine, but as a parent attribute to avoid setting a template for each item I want to store template url. Obviously, the template is the same for every item.

    This stage has not been set yet. So I think the easiest way to implement it:

      templateUrl: (TELEMENT, TATRS) - & gt; Atter ('Template') or '/item-template.html'  

    But I'm not sure this is the best way ...

    So my question What is the best way to achieve this?

    Thank you!

  • I want to deal with this

      // index.jade Doctype html html included / head body h1 my site p Welcome to my super lame site. This includes / foot  

    I have to keep markup stuff out of the code and believe the markup that you are doing


    Comments

    Popular posts from this blog

    Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

    multithreading - PhantomJS-Node in a for Loop -

    c++ - MATLAB .m file to .mex file using Matlab Compiler -