i want bootstrap tooltip mouse cursor. possible in angularjs. if not alternative of this.
yes, let me explain example how can display tooltip angularjs + bootstrap.
controller:
var myapp = angular.module("myapp", []); function myctrl($scope) { $scope.items = [{ name: "item 01", tooltip: "this item 01 tooltip!"}, { name: "item 02", tooltip: "this item 02 tooltip!"}]; console.log("myctrl"); } myapp.directive('tooltip', function () { return { restrict:'a', link: function(scope, element, attrs) { $(element) .attr('title',scope.$eval(attrs.tooltip)) .tooltip({placement: "right"}); } } })
html: use tooltip
@ <a>
html tag display tooltip.
<div ng-app="myapp"> <div ng-controller="myctrl"> <li ng-repeat="item in items" > <a rel="tooltip" tooltip="item.tooltip">{{item.name}}</a> </li> </div> </div>
and that's done. please see live example.
Comments
Post a Comment