Created
March 9, 2015 14:47
-
-
Save gangadharjannu/93cd4bb5ac1d874ba77a to your computer and use it in GitHub Desktop.
JS Bin // source http://jsbin.com/cehupucehuvi/1
This file contains 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.14/angular.min.js"></script> | |
<meta charset="utf-8"> | |
<title>JS Bin</title> | |
<style id="jsbin-css"> | |
.displayClear{ | |
cursor:pointer; | |
color:#38468F; | |
position:relative; | |
right:21px; | |
} | |
.hideClear{ | |
display:none; | |
} | |
</style> | |
</head> | |
<body ng-app="myApp"> | |
<div ng-controller="clearCtrl"> | |
<div> | |
<input type="text" ng-model="userModal" ng-keyup="clearIcon(true)" ng-blur="clearIcon(false)"/> | |
<span ng-click="clearInput()" ng-class="clearIconVar?'displayClear':'hideClear'" >x</span> | |
</div> | |
{{hi}} | |
</div> | |
<script id="jsbin-javascript"> | |
var showApp = angular.module('myApp', []) | |
.controller('clearCtrl', function($scope) { | |
$scope.clearIconVar=false; | |
$scope.clearIcon = function(param){ | |
$scope.clearIconVar=param; | |
}; | |
$scope.hi="hi"; | |
$scope.clearInput=function(){ | |
alert("hi"); | |
}; | |
}); | |
</script> | |
<script id="jsbin-source-html" type="text/html"><!DOCTYPE html> | |
<html> | |
<head> | |
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.14/angular.min.js"><\/script> | |
<meta charset="utf-8"> | |
<title>JS Bin</title> | |
</head> | |
<body ng-app="myApp"> | |
<div ng-controller="clearCtrl"> | |
<div> | |
<input type="text" ng-model="userModal" ng-keyup="clearIcon(true)" ng-blur="clearIcon(false)"/> | |
<span ng-click="clearInput()" ng-class="clearIconVar?'displayClear':'hideClear'" >x</span> | |
</div> | |
{{hi}} | |
</div> | |
</body> | |
</html></script> | |
<script id="jsbin-source-css" type="text/css">.displayClear{ | |
cursor:pointer; | |
color:#38468F; | |
position:relative; | |
right:21px; | |
} | |
.hideClear{ | |
display:none; | |
} | |
</script> | |
<script id="jsbin-source-javascript" type="text/javascript">var showApp = angular.module('myApp', []) | |
.controller('clearCtrl', function($scope) { | |
$scope.clearIconVar=false; | |
$scope.clearIcon = function(param){ | |
$scope.clearIconVar=param; | |
}; | |
$scope.hi="hi"; | |
$scope.clearInput=function(){ | |
alert("hi"); | |
}; | |
});</script></body> | |
</html> |
This file contains 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
.displayClear{ | |
cursor:pointer; | |
color:#38468F; | |
position:relative; | |
right:21px; | |
} | |
.hideClear{ | |
display:none; | |
} |
This file contains 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
var showApp = angular.module('myApp', []) | |
.controller('clearCtrl', function($scope) { | |
$scope.clearIconVar=false; | |
$scope.clearIcon = function(param){ | |
$scope.clearIconVar=param; | |
}; | |
$scope.hi="hi"; | |
$scope.clearInput=function(){ | |
alert("hi"); | |
}; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment