在键盘事件中,我想动态更改ng-include
指令的src
值。
最佳答案
这是一个可以帮助您的代码示例:
<div class="example-animate-container" ng-include="{{template.url}}">
然后在指令或 Controller 中
$(document).on("keydown", function () {
template.url = "put the value here";
$scope.$apply();
});
关于angularjs - 首次加载后如何更改angularJS中ng-include的 "src"属性值?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17093007/