Can you change templateUrl on the fly?

前端 未结 7 2224
时光取名叫无心
时光取名叫无心 2020-11-29 01:55

Is it possible to change templateUrl on the fly by passing values in the directive\'s scope? I want to pass data to controller that will render the page based on the data th

7条回答
  •  猫巷女王i
    2020-11-29 02:20

    I've changed the answer from pkozlowski.opensource a little.

    From:

    var boom = $parse(iAttrs.data)(scope);
    

    To:

    var boom = scope.data.myData
    

    That worked for me and it's possible to use

     
    

    in the directive.

提交回复
热议问题