UNPKG

@ntesmail/shark-angularjs

Version:

shark-angularjs组件库,基于shark-ui打造的angular组件库

33 lines (32 loc) 1.36 kB
<div ng-controller="DemoTabsCtrl"> <sharktabs name="tabs" tabs="tabs" active="active" on-tab-switched="tabSwitched"></sharktabs> </div> <script type="text/javascript"> angular.module('demoApp') .controller('DemoTabsCtrl', ['$scope', '$timeout', function ($scope, $timeout) { $scope.tabs = [{ title: '前端组', template: '<span style="color:red;">{{tab1Content}}</span>' }, { title: '视觉组', template: '<span style="color:green;">{{tab2Content}}</span>' }, { title: '运营组', templateUrl: '/shark-angularjs/examples/templates/tabs-3.html' }, { title: '市场组', templateUrl: '/shark-angularjs/examples/templates/tabs-4.html' }]; $scope.tabSwitched = function (index) { console.log('tab切换到:' + index); }; $scope.active = 1; $scope.tab1Content = "都是小哥哥"; $scope.tab2Content = "都是阿姨"; $scope.tab3Content = "都是小姐姐"; $scope.tab4Content = "都是大叔"; $scope.openDialog = function (size) { alert('点击了我'); }; }]); </script>