admin管理员组

文章数量:1360344

I have the following Problem: I have an input field, but it only works without the tooltip, with the tooltip I get undefined.

HTML:

<input type="text" ng-model="DiskPermissions" class="col-md-3 m-x-auto" tooltip='Permissions "Disk"'>
<input type="text" ng-model="DiskPermissions" class="col-md-3 m-x-auto">

Controller:

var diskToAdd={ size: $scope.DiskSizeGB , mountepoint:'/appl/' + $scope.MountPoint , permissions: $scope.DiskPermissions , options: $scope.DiskOptions , owner: $scope.DiskOwner , filesystemType: $scope.DiskFilesystemtype , diskPart: ''};

I have the following Problem: I have an input field, but it only works without the tooltip, with the tooltip I get undefined.

HTML:

<input type="text" ng-model="DiskPermissions" class="col-md-3 m-x-auto" tooltip='Permissions "Disk"'>
<input type="text" ng-model="DiskPermissions" class="col-md-3 m-x-auto">

Controller:

var diskToAdd={ size: $scope.DiskSizeGB , mountepoint:'/appl/' + $scope.MountPoint , permissions: $scope.DiskPermissions , options: $scope.DiskOptions , owner: $scope.DiskOwner , filesystemType: $scope.DiskFilesystemtype , diskPart: ''};
Share Improve this question edited Sep 19, 2016 at 7:06 Thomas 182k56 gold badges378 silver badges504 bronze badges asked Sep 19, 2016 at 7:05 FabianFabian 31 gold badge1 silver badge3 bronze badges 3
  • is tooltip a directive? – brk Commented Sep 19, 2016 at 7:07
  • Wele to SO! You can format your code by indenting it with four spaces, or just select it and click the {} button. – Thomas Commented Sep 19, 2016 at 7:15
  • I'm not sure of what is tooltip ( if its your own directive or a tierce js lib ) but you can add the module 'ui.bootstrap' which provide very nice tooltip and use it with these directives : tooltip-placement="top-right" uib-tooltip="I'm a tooltip" – amdev Commented Sep 19, 2016 at 7:28
Add a ment  | 

2 Answers 2

Reset to default 6

The attribute isn't called tooltip, it's called title:

<input type="text" ng-model="DiskPermissions" class="col-md-3 m-x-auto" title='Permissions "Disk"'>

You can try matTooltip as:

<input type="text" ng-model="DiskPermissions" class="col-md-3 m-x-auto" matTooltip='Permissions "Disk"'>

本文标签: javascriptAdding tooltip at inputangular jsStack Overflow