我使用指令:
return {
restrict: 'E',
scope: {
isread: "=isread"
,....
templateUrl: 'list.html',
list.html是:
<span ng-show="isread"></span>
父母在我调用指令的地方进行修改:
<div class="top-menu" ng-controller="NotificationController">
<notification-list isread="is_read"></notification-list>
</div>
NotificationController
:
scope.makeRead = function() {
$scope.is_read = true;
}
为什么当我在控制器中更改$scope.is_read = true;
时,它在变量isread
中的指令中没有更改?
答案 0 :(得分:0)
return {
restrict: 'E',
scope: {
isread: "="
,....
templateUrl: 'list.html',