Created
November 12, 2015 16:15
-
-
Save screamy/bdcf3ed90fe33d27edee to your computer and use it in GitHub Desktop.
angular-directive
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @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