I've two bootstrap tabs where I'm showing list on the first Tab and on the second tab there will be textboxes for adding new record.
<ul class="nav nav-tabs naviborder">
<li class="active" ng-click="showTasksList()">
<a class="icontab" data-target="#divTasks" data-toggle="tab">Tasks</a>
</li>
<li ng-click="addTask()" id="liCreateTask">
<a id="aAddTask" class="icontab" data-target="#divCreateTask" data-toggle="tab">Create Task</a>
</li>
</ul>
Now on the list, I've some edit button and on clicking that, I will populate the textboxes in the second tab and show the second tab automatically.
Now, My problem is : I'm able to populate the textboxes but uanble to switch to the second tab.
My AngularJs Code :
$scope.EditFieldForceTask = function (TaskData) {
$scope.TaskEditMode = true;
$scope.TaskContactName = TaskData.CONTACT_NAME;
$scope.TaskContactNumber = TaskData.CONTACT_NUMBER;
$('#aAddTask').click();
//$scope.tab2Click();
}
Upon calling this $('#aAddTask').click();, I'm getting three errors like
Error: [$rootScope:inprog] http://errors.angularjs.org/1.4.8/$rootScope/inprog?p0=%24apply
at Error (native)
I've also tried to define a ng-click event to that a tag, but even that's not working.
But when I try to call the function $('#aAddTask').click(); from console, it's working fine.
Can anyone please tell me the mistake I'm doing?
setTimeout(function () { $('#abcAddTask').click(); }, 200);