我使用指令:
return {
restrict: 'E',
scope: {
isread: "=isread"
,....
templateUrl: 'list.html',
其中list.html是:
<span ng-show="isread"></span>
和我称为指令的父trmplate:
<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
中没有更改指令?
return {
restrict: 'E',
scope: {
isread: "="
,....
templateUrl: 'list.html',