我正在遵循Angular bootstrap文档中的工具提示示例,但似乎无法使该工具提示正常工作。我正在使用Angular 1.5.5版和angular-bootstrap 0.11.2版。
这是我的代码:app.js
angular.module('app', ['ui.bootstrap'])
.controller('TooltipDemoCtrl', function ($scope) {
//doesn't matter from what I can tell
})
index.html
<head>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
<script src="bower_components/jquery/dist/jquery.js"></script>
<script src="bower_components/angular/angular.js"></script>
<script src="bower_components/angular-bootstrap/ui-bootstrap-tpls.js"></script>
</body>
tooltip.html
<div ng-controller="TooltipDemoCtrl">
<div class="w-col w-col-4 w-col-small-4 w-col-tiny-4 w-clearfix icon-col">
<img width="17" src="../assets/images/pc-icon-two.png"
uib-tooltip="NOT WORKING" class="info-icon-five1">
</div>
</div>
我有一张要用作工具提示的图像。我尝试将uib-tooltip移到img标签和div标签中。都行不通。这里发生了什么?
这为我工作:
html代码:
<!DOCTYPE html>
<html ng-app="myApp">
<head>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet">
<script src="//code.angularjs.org/1.5.0-rc.2/angular.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/angular-ui-bootstrap/1.2.4/ui-bootstrap-tpls.js"></script>
<script src="SO.js"></script>
</head>
<body >
<div ng-controller="TooltipDemoCtrl">
<div class="w-col w-col-4 w-col-small-4 w-col-tiny-4 w-clearfix icon-col">
<img width="17" src="SO/nick_pic2.jpg" uib-tooltip="WORKING" class="info-icon-five1">
</div>
</div>
</body>
</html>
角度代码:
var app = angular.module('myApp', ['ui.bootstrap']);
app.controller('TooltipDemoCtrl', function ($scope) {
});
这在页面的左上角显示了一张图片。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句