2
在將作用域綁定到我的指令/控制器後,我不能再使用自己的指令了,是否應該修復?我試圖尋找答案,但沒有到目前爲止..
ANGULARJS:
return {
scope: { fullpost:'@' },
controller: function ($scope, $element) {
// Edit Btn
$scope.editbtn = "Edit";
的$ scope.editbtn不會在HTML顯示了。
HTML:
<full-post fullpost="fullpost">
<!-- edit tools -->
<div class='yardtools'>
<button id='edit' ng-click='edit()'><i class='fa fa-pencil-square-o'></i> {{ editbtn }}</button>
<button id='update' class='hidden'><i class='fa fa-wrench'></i> Update</button>
<button id='delete'ng-click='delete()'class='hidden'><i class='fa fa-trash-o'></i> Delete</button>
</div>
<!-- post -->
<div class='yardman-post' data-post-id=" + id + ">
<div ym='info'>
<p>Post id: <em> {{ fullpost.id }}</em>, Posted on: <em>{{ fullpost.date }}</em>, by <em>AUTHOR</em>
</p>
</div>
<div ym='title' contenteditable='false'>{{ fullpost.title }}</div>
<div ym='body' contenteditable='false'>{{ fullpost.text }}</div>
</div>
</full-post>
您可以加入更多的代碼,請與HTML? –
@ pankajparkar,我添加了html。 –
你的意思是你想改變指令中的按鈕文本? –