1
我用指令:为什么不能在指令Angular JS中使用两种绑定方式?
return {
restrict: 'E',
scope: {
isread: "=isread"
,....
templateUrl: 'list.html',
其中list.html是:
<div class="top-menu" ng-controller="NotificationController">
<notification-list isread="is_read"></notification-list>
</div>
而且NotificationController
:
scope.makeRead = function() {
$scope.is_read = true;
}
从那里我称之为指令
<span ng-show="isread"></span>
和家长trmplate
为什么当我在控制器中更改$scope.is_read = true;
时,在变量isread
中的指令中没有更改?
如何在控制器中检查“is_read”正在更新为true? –
默认情况下它是:'$ scope.is_read = false'在控制器中 – Daniel
检查控制器中的$ scope.is_read是否更新为true –