Dynamic templateUrl - AngularJS

后端 未结 4 464
南笙
南笙 2020-12-10 02:40

So as of Angular 1.1.4, you can have a dynamic template url. From here,

templateUrl - Same as template but the template is loaded from the specified URL

4条回答
  •  长情又很酷
    2020-12-10 03:22

    templateUrl: function (elem, attrs) {
    return attrs["template"] == "table" ?
    "tableTemplate.html" : "itemTemplate.html";
    }
    

提交回复
热议问题