JSFiddle - React, Tailwind, and code Playground

by stvnmntjy

HTML

<script src="//cdnjs.cloudflare.com/ajax/libs/angular.js/1.1.3/angular.js"></script>
<max-price />

CoffeeScript

@app = angular.module 'app', []
@app.directive 'maxPrice', ->
  restrict: 'E'
  replace: true
  template:
    """
    <span>
      <label>Max Price:</label>
      <input type="number" min="1" max="100" name="MaxPrice" data-ng-model="price">
    </span>
    """
  scope: true
  link: (scope, iElement, iAttrs, controller) ->
    scope.$watch 'price', ->
      scope.price = scope.price ? 1
      return
    return

angular.bootstrap document, ['app']