JSFiddle - React, Tailwind, and code Playground

by Mark

HTML

<div data-ng-controller="test">
<div class="box">
    <input type="text" id="search" maxlength="75" data-ng-model="keywords" />
</div>
<searched data-ng-model="keywords"></searched>
</div>

JavaScript

var app = angular.module('myApp', []);

app.directive('searched', function(){
	return {
		restrict: 'E',
		replace: true,
    	scope: {
    		keywords: '=ngModel'
    	},
    	template: '<span ng-show="keywords.length > 0"><span class="field">You searched for:</span> {{ keywords }}</span> '
	};
});

app.controller("test", ['$scope', function($scope) {
	$scope.keywords = null;
}]);