Hi,
I have 2 tabs on form
by default i need to select one tab
in form i need to display Volvo value by deafult and highlight selected tab on form by default
could you please check it and help me
@{
Layout = null;
}
<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular.min.js"></script>
</head>
<body ng-app="myApp" ng-controller="myCtrl">
<button ng-click="Add();" style="margin-left: 15px;">Add</button>
<div ng-show="tabs">
<div class="panel-heading">
<div class="row">
<div class="col-xs-6">
<a href="#" class="active" id="login-form-link" ng-click="allowence()">Allowence</a>
</div>
<div class="col-xs-6">
<a href="#" id="register-form-link" ng-click="deduction()">Deduction</a>
</div>
</div>
<hr>
</div>
</div>
<div ng-show="form">
<h1>{{carname}}</h1>
</div>
<div ng-show="form1">
<h1>{{carname1}}</h1>
</div>
<script>
var app = angular.module('myApp', []);
app.controller('myCtrl', function ($scope) {
$scope.form = false;
$scope.form1 = false;
$scope.carname = "Volvo";
$scope.carname1 = "Volvo1";
$scope.tabs = false;
$scope.Add = function () {
$scope.tabs = true;
}
$scope.allowence = function () {
$scope.form = true;
$scope.form1 = false;
}
$scope.deduction = function () {
$scope.form1 = true;
$scope.form = false;
}
});
</script>
</body>
</html>