Can you change templateUrl on the fly?

前端 未结 7 2228
时光取名叫无心
时光取名叫无心 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条回答
  •  南笙
    南笙 (楼主)
    2020-11-29 02:16

    Those answers are good, but not professional. There is a syntax of using templateUrl, which we don't use often.It can be a function which returns a url.That function has some arguments. If you want more here is a cool article

    http://www.w3docs.com/snippets/angularjs/dynamically-change-template-url-in-angularjs-directives.html

提交回复
热议问题