我有一个angular指令:
angular.module("App").directive("myButtons", function () {
return {
restrict: "E",
scope:
{
teststring: '@'
},
templateUrl: "test.html"
}
});使用以下模板:
<div>
<input type="button" onclick="teststring" value="Hi" />
</div>这是HTML中的指令:
<my-buttons teststring="Whatsup" />我希望传递给teststring的值出现在呈现的html中。
目前我只得到了onclick="teststring“。
我做错了什么。我尝试在模板上添加{{ }},并在作用域值上添加@,=和&。
https://stackoverflow.com/questions/44416369
复制相似问题