JSFiddle - React, Tailwind, and code Playground

by ptubig

HTML

<script src="https://github.com/mathiasbynens/jquery-placeholder/blob/master/jquery.placeholder.js"></script>
<div ng-app="myApp" ng-controller="MainCtrl">
    <input type="text" ng-model="inputValue" placeholder="Placeholder!" />
    <p>Value: {{inputValue}}</p>
</div>

JavaScript

angular.module('myApp', [])
    .directive('placeholder', function () {
    return {
        restrict: 'A',
        link: function (scope, element, attrs) {
          var placeholder = attrs.placeholder;
          if (placeholder) {
            $(element).placeholder();
          }
        }
    };
  })

  .controller('MainCtrl', function ($scope) {
    $scope.inputValue = 'Hello World';
  });