Skip to content

Instantly share code, notes, and snippets.

@Epotignano
Created August 25, 2015 19:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Epotignano/16c64c9cc25b47396ec3 to your computer and use it in GitHub Desktop.
Save Epotignano/16c64c9cc25b47396ec3 to your computer and use it in GitHub Desktop.
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
}
})
;
<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