Q: Binding input number with text in AngularJS I need to bind inputs of type 'number' with a different models which are strings. I've managed to bind them using a directive like:
app.directive('input', function () {
    return {
        restrict: 'E',
        require: 'ngModel',
        priority:999999,
        link: function (scope, elem, attrs, ctrl) {
            //Check del tipo input
            if (attrs.type.toLowerCase() !== 'number') 
            {
                return;
            } 
            //Paso a numero el valor a colocar
            ctrl.$formatters.push(function (value) 
            {
                return value ? parseFloat(value) : null;
            });
        }
    };
});

And the HTML is like this:
<input class="form-control" type="number" ng-model="scopeValue" />   

Up to here, there is no problem with binding. But, when I write a ng-repeat and ng-switch combined this directive is not executed. Sample code:
<div ng-repeat="attribute in attributes" ng-switch on="attribute.type">
  <div class="input-group">
    <span class="input-group-addon" id="basic-addon2">{{attribute.label}}</span>
    <input class="form-control" ng-switch-when="text" ng-model="attribute.value" type="text" name="{{attribute.label}}" value="{{attribute.value}}">                                   
    <input class="form-control" ng-switch-when="number" ng-model="attribute.value" type="number" name="{{attribute.label}}" value="{{attribute.value}}">
  </div>
</div>

Here the directive link code is never thrown and the inputs with number are never completed. As far as I know, the directive checks all the inputs and has the ngModel dependence. Why is it never executed?
