Skip to content

Instantly share code, notes, and snippets.

@screamy
Created November 12, 2015 16:15
Show Gist options
  • Save screamy/bdcf3ed90fe33d27edee to your computer and use it in GitHub Desktop.
Save screamy/bdcf3ed90fe33d27edee to your computer and use it in GitHub Desktop.
angular-directive
/**
* @ngdoc controller
* @name tooltipCtrl
* @type tooltipCtrl
*
*/
class A {
constructor() {
this.items = 'item';
}
highlight() {
}
}
function ddo() {
return {
restrict: 'E',
scope: {
message: '=',
position: '@'
},
bindToController: true,
controllerAs: 'tooltipCtrl',
controller: A,
template: `
<div ng-click="tooltipCtrl.highlight()">
<span ng-bind="tooltipCtrl.items"></span>
</div>
`
};
}
/**
* @ngdoc directive
* @name cnTooltip
* @param {String} message
* @param {String} position
* @restrict E
*/
export default ddo;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment