嗨请帮我我新角js我的li范围不能在角js中删除为什么?
我只是创建一个函数。 我重复了这个内容。 我创建了一个功能,添加下一个选项卡部分并删除此部分。 我创建一个相同的功能,以另一个标签添加prev选项卡部分并删除此部分。
但我只有数据复制这个功能不删除数据,不显示。
请帮我
我的代码是这样的
HTML代码
<body ng-app="taskPanel">
<div class="" ng-controller="TasksController">
<tabset panel-tabs="true" panel-class="panel-inverse">
<tab>
<tab>
<tab-heading> <span class="hidden-xs">ACTIVE</span> <span class="badge badge-primary">{{tasksComplete.length}}</span></tab-heading>
<div class="tasklist">
<ol class="panel-tasks">
<li ng-repeat="item in tasksComplete">
<a href="#" class="preview-question">
<i class="fa fa-eye">eye</i>
</a>
<label>
<span class="task-description">{{item.title}}</span>
<span class="label label-{{item.color || 'primary'}}" ng-show="item.label">{{item.label}}</span>
<div class="more-icn">
<div class="pull-left">
<button class="active-check" ng-click="pushActive(this, item)">Push to InActive Tab</button>
</div>
</div>
</label>
</li>
</ol>
</div>
</tab>
<tab>
<tab-heading> <span class="hidden-xs">InACTIVE</span> <span class="badge badge-primary">{{tasksComplete.length}}</span></tab-heading>
<div class="tasklist">
<ol class="panel-tasks">
<li ng-repeat="item in tasksInComplete">
<a href="#" class="preview-question">
<i class="fa fa-eye"></i>
</a>
<label>
<span class="task-description">{{item.title}}</span>
<span class="label label-{{item.color || 'primary'}}" ng-show="item.label">{{item.label}}</span>
<div class="more-icn">
<div class="pull-left">
<button class="active-check" ng-click="pushInActive(this, item)">Push To Active Tab</button>
</div>
</div>
</label>
</li>
</ol>
</div>
</tab>
</tabset>
</div>
</body>
角的js代码是
//代码放在这里
var appan = angular.module('taskPanel', []);
appan.controller('TasksController', ['$scope', function($scope){
$scope.tasksComplete = [
{ title: "I m first" },
{ title: "I m Second" },
{ title: "I m thrid" }
];
$scope.tasksInComplete = [
{title: "i m incompletred 1"},
{title: "i m incompletred 2"},
{title: "i m incompletred 3"}
];
$scope.remove = function(scope){
scope.remove();
};
$scope.pushActive = function(scope, item){
$scope.tasksInComplete.push(item);
scope.remove();
};
$scope.pushInActive = function(scope, item){
$scope.tasksComplete.push(item);
scope.remove();
};
}]);
HI @Kaken我可以延迟到这个功能我想我点击在标签有些需要3秒左右的时间比移动到下一个标签 – 2014-09-04 08:10:41
嗨@RohitAzad尝试使用$超时服务。像http://plnkr.co/edit/aB1XNuaAqe52iSAjRLXl?p=preview – Kaken 2014-09-04 08:54:15