JSFiddle - React, Tailwind, and code Playground
by Bruno Sabetta
HTML
<div ng-app="Joy" ng-controller="MainCtrl">
<div ng-model="myInputValue" amount-input-currency></div>
{{myInputValue}}
</div>
JavaScript
angular.module('Joy', [])
.controller('MainCtrl', MainCtrl)
.directive('amountInputCurrency', amountInputCurrency);
MainCtrl.$inject = ['$scope'];
function MainCtrl($scope) {
$scope.myInputValue = "Bear";
};
function amountInputCurrency() {
return {
restrict: 'A',
require: 'ngModel',
//template: '<input type="text" ng-model="myInputValue" />',
scope: {
myInputValue = "="
},
link: function(scope, elem, attrs, model) {
}
}
};