JSFiddle - React, Tailwind, and code Playground
HTML
<script src="https://unpkg.com/angular@1.5.9/angular.js"></script>
<div ng-app="myApp">
<h1>Angular 1.5.9 Example{{}}</h1>
<example ></example>
</div>
JavaScript
myApp = angular.module("myApp",[]);
myApp.component('example', {
template: '<button type="button" ng-click="$ctrl.click()">click me</button>',
bindings: { callback: '&' },
controller: function () {
this.click = () => {
this.value = 'clicked';
this.callback({$value: this.value});
};
},
});
myApp.component('useExample', {
template: '<example callback="$ctrl.useCallback($value)"></example>',
controller: function () {
this.useCallback = (v) => { alert(v); };
},
});