如何在前2个面板上方添加*必需,以根据需要标记它

时间:2016-03-16 23:00:06

标签: angularjs angular-ui-bootstrap

- 使用angular bootstrap nav标签组件 用户信息和教育信息是必填字段。所以我想在这些标签上方添加*必需用于通知用户。

    <body ng-app="myApp" ng-controller="Panel1">
  <ul class="nav nav-tabs">
    <li ng-class="{'active' : activeTab == 1}"><a href="" ng-click="setActiveTab(1)">**User Information**</a></li>
    <li ng-class="{'active' : activeTab == 2}"><a href="" ng-click="setActiveTab(2)">**Education information**</a></li>
    <li ng-class="{'active' : activeTab == 3}"><a href="" ng-click="setActiveTab(3)">Employeement information</a></li>
  </ul>

  <div class="tab-content">
    <div ng-class="{'tab-pane active': activeTab === 1, 'tab-pane' : activeTab !== 1}">abc</div>
    <div ng-class="{'tab-pane active': activeTab === 2, 'tab-pane' : activeTab !== 2}">def</div>
    <div ng-class="{'tab-pane active': activeTab === 3, 'tab-pane' : activeTab !== 3}">ehg </div>
  </div>
        angular.module("myApp", [])
        .controller("Panel1", ['$scope', function($scope) {
            $scope.activeTab = 1;

            $scope.setActiveTab = function(tabToSet) {
                $scope.activeTab = tabToSet;
            }
        }]);
  </script>

0 个答案:

没有答案