A Pen by Captain Anonymous on CodePen.
Created
July 3, 2015 11:38
-
-
Save ggviana/a0ff5b2ff4d325653784 to your computer and use it in GitHub Desktop.
aOqwdj
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<script src="//cdnjs.cloudflare.com/ajax/libs/angular.js/1.3.14/angular.min.js"></script> | |
</head> | |
<body ng-app="demo"> | |
<div class="search-input" ng-controller="SearchInputCtrl"> | |
<input type="text" ng-model="search" placeholder="search"> | |
<span class="close-button" ng-show="search.trim().length > 0" title="Clear" ng-click="reset();" style="cursor: pointer;"> | |
× | |
</span> | |
</div> | |
<script> | |
angular | |
.module('demo', []) | |
.controller('SearchInputCtrl', function($scope) { | |
$scope.search = ""; | |
$scope.reset = function() { | |
$scope.search = ""; | |
}; | |
}); | |
</script> | |
</body> | |
</html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src="//cdnjs.cloudflare.com/ajax/libs/angular.js/1.3.14/angular.min.js"></script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment