UNPKG

@ntesmail/shark-angularjs

Version:

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

22 lines (21 loc) 1.01 kB
<div ng-controller="DemoTooltipCtrl"> <p ng-repeat="item in tooltipList track by $index"> <button class="btn btn-sm btn-info" name="tooltip{{item.id}}" sharktooltip template-url="item.templateUrl">{{item.btnText}}</button> </p> </div> <script type="text/javascript"> angular.module('demoApp') .controller('DemoTooltipCtrl', ['$scope', '$sce', '$timeout', function ($scope, $sce, $timeout) { $scope.tooltipList = [{ id: '101', btnText: 'btn1', templateUrl: '/shark-angularjs/examples/templates/tooltip-1.html', content: $sce.trustAsHtml('<div><p>内容1:</p><span>我是按钮1</span></div>') }, { id: '102', btnText: 'btn2', templateUrl: '/shark-angularjs/examples/templates/tooltip-2.html', content: $sce.trustAsHtml('<div><p>内容2:</p><span>我是按钮2</span></div>') }]; }]); </script>