2
如何清除范围变量,如果我将它传递到功能,无需从$范围调用它?AngularJS除去范围变量函数
// controller
$scope.user_id = 1;
$scope.example = function(uid) {
// remove $scope.user_id without accessing it like a scope
// smth like
uid = null; // won't work
};
// html
<div ng-click="example(user_id)">Click me!</div>
所以我希望能有完全隔离功能
好吧,我看到的。谢谢! – user256968
@NG我已经添加了更多*“隔离”*示例 – Phil