I am a rookie in angularjs. I'm currently working on a page where i should display various forms inside tabs.I've worked on a code which activates the other tab on a button click.Heres the html
<!DOCTYPE html>
<html ng-app="ui.bootstrap.demo">
<head>
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.4.7/angular.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.4.7/angular-animate.js"></script>
<script src="//angular-ui.github.io/bootstrap/ui-bootstrap-tpls-0.14.3.js"></script>
<script src="example.js"></script>
<link href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
<div ng-controller="TabsDemoCtrl">
<uib-tabset vertical="true" type="pills">
<p>Select a tab by setting active binding to true:</p>
<p>
<button type="button" class="btn btn-default btn-sm" ng-click="tabs[0].active = true">Select second tab</button>
<button type="button" class="btn btn-default btn-sm" ng-click="tabs[1].active = true">Select third tab</button>
</p>
<uib-tab ng-repeat="tab in tabs" heading="{{tab.title}}" active ="tab.active" disable="tab.disabled">
{{tab.content}}
</uib-tab>
</uib-tabset>
<hr />
</div>
</body>
</html>
and here's the controller.js
angular.module('ui.bootstrap.demo', ['ngAnimate', 'ui.bootstrap']);
angular.module('ui.bootstrap.demo').controller('TabsDemoCtrl', function ($scope, $window) {
$scope.tabs = [
{ title:'Dynamic Title 1', content:'Dynamic content 1' },
{ title:'Dynamic Title 2', content:'Dynamic content 2'}
];
});
here's the plunker link..http://plnkr.co/edit/v23qWGzqbw3Y5o51KhHf?p=preview
what i need is to get the buttons inside the 'dynamic content' i.e when we click the button in tab1 content,it activates the other tab. I also have to include much other html elements too. What are the methods in which i can achieve this?