且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

使用 AngularJS 删除 DOM 元素

更新时间:1970-01-01 07:55:42

DOM 元素中使用 ngIf 并执行以下操作:

use ngIf in your DOM element and do something like this:

模板:

<element ng-if="hideElemet"></element>

控制器:

if ($location.path().indexOf('resetpass') > -1) {
      $scope.hideElement = false
}

ngIf 将从 DOM 中删除元素

ngIf will remove the element from the DOM