Created
August 25, 2015 19:35
-
-
Save Epotignano/16c64c9cc25b47396ec3 to your computer and use it in GitHub Desktop.
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 selectCtrl = function($element) { | |
var ctrl = this; | |
$element.on('click', function(e){ | |
//use a method that I have to see in the docs for select the text in an input that I don't remember now, should be accesible | |
//$element | |
}) | |
}; | |
angular.module('emiliano.utils') | |
.controller('selectCtrl', selectCtrl) | |
.directive('selectAll', function(){ | |
return { | |
restrict : 'AC', //A = attribute, C = class, E = Element | |
controller: 'selectCtrl as ctrl', | |
bindToController: true, //true or false | |
} | |
}) | |
; | |
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
<input type="text" ng-model="ctrl.someModel" selectAll/> | |
<input type="text" ng-model="ctrl.someModel" class="selectAll"/> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment